Search code examples
androidflutterstatusbarandroid-themeflutter2.0

Dark status bar icons after migrating to Flutter 2


I have recently updated the Flutter version from 1.22.6 to 2.0.2. But now after I create a new flutter project (default counter app), the status bar icons are dark. They were light before migrating to 2.0.2:

enter image description here

How can it be fixed? I've tried to set the light statusBarIconBrightness in the AppBarTheme, but it doesn't work:

    appBarTheme: AppBarTheme(
      systemOverlayStyle: SystemUiOverlayStyle(
        statusBarIconBrightness: Brightness.light,
      ),
    ),

Solution

  • You Should set statusBarColor too for dart statusBarColor you should use bright colors for brightness

    AppBarTheme(color: Colors.blue,
                brightness: Brightness.dark,
                systemOverlayStyle: SystemUiOverlayStyle(
                      statusBarColor: Colors.blue
                    ))