Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set status bar color if using sliver app bar

As I am having sliver app bar in my screen, I am not using AppBar() widget. So by default the status bar color is white.

Is there a way to change the color of status bar from sliver.

enter image description here

Below code works for Android as expected, but not for iOS.

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
    statusBarColor: kPrimaryColor,
  ));

If using app bar to change the color, then sliver breaks enter image description here

like image 860
Jitan Gupta Avatar asked Oct 17 '25 10:10

Jitan Gupta


1 Answers

Try this:

Scaffold(
    body: SafeArea(
      top: false,
      bottom: false,
      child: Container(), // Replace this container with your UI widget
    ),
)
like image 101
Osama Remlawi Avatar answered Oct 20 '25 00:10

Osama Remlawi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!