Is it possible to explicitly set gradient color for the status bar? 'statusBarColor' expects Color, but what about gradient? How to paint status bar in gradient? If I use SafeArea, status bar is white. But my SliverAppBar is painted in gradient color.
Scaffold(
body: SafeArea(
child: CustomScrollView(
slivers: [
SliverAppBar(
flexibleSpace: FlexibleSpaceBar(
centerTitle: true,
title: Text(
'My App',
style: TextStyle(
fontSize: 16.0,
),
),
background: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: <Color>[
Color(0xFF50AC5B),
Color(0xFF92C156),
],
),
),
),
),
elevation: 0.0,
floating: true,
),
SliverList(
delegate: SliverChildListDelegate(
[
//...
],
),
),
],
),
),
backgroundColor: const Color(0xFFFBFDFF),
);
}
}
Wrap your SafeArea into a Container that adds a background gradient
or just turn off your SafeArea in the top portion of the app if it's not required there, like this:
Let me know if any of this solution works.