Home > Software design >  Fully transparent status bar in Flutter
Fully transparent status bar in Flutter

Time:05-13

I try to set transparent status bar in my Flutter App, but this does not make status bar fully transparent, it's like some dark color with opacity (the app has white background):
Transparent statusbar

CodePudding user response:

You can use sample code to have custom statusBar color :

      Widget build(BuildContext context) {
   return Scaffold(
/*  appBar: AppBar(), */ //  <==== solution worked when no appBar
    body: Container(
      color: Colors.red, // < ===  specific color for status bar
      child: SafeArea(
        child: Container(
            color: Colors.blue,
            child: Center(child: Text("Sample"))),
      ),
    ));}

CodePudding user response:

I've resolved my issue by setting to false SystemUiOverlayStyle.systemStatusBarContrastEnforced to false. Apparently, flutter was forcing contrast and automatically set background for transparent black and icons white, while I needed black icons on transparent background (hence white because of app's background).

Big thanks for everybody who have tried to help me.

  • Related