Victor Semenovich
Victor Semenovich

Reputation: 576

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

Upvotes: 0

Views: 691

Answers (2)

Mahmood Bkh
Mahmood Bkh

Reputation: 539

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

Upvotes: 1

estatico
estatico

Reputation: 105

Try this

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

Upvotes: 0

Related Questions