0

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,
      ),
    ),

2 Answers2

1

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
                ))
Mahmood Bkh
  • 499
  • 2
  • 4
  • 15
0

Try this

 return MaterialApp(
     theme: ThemeData(
          appBarTheme: Theme.of(context).appBarTheme.copyWith(brightness: Brightness.dark,),
       ...
     ),
     ...
 );
estatico
  • 93
  • 8