Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why my status bar icons are black and why can't I change it? (After Flutter 2.0 Upgrade)

Tags:

flutter

dart

After I upgrade Flutter 2.0, the color of the status bar's icon/text changed from white to black. After I upgraded because I did not make any other changes. Now the status bar icons of all apps I run is black. Why?

enter image description here

I tried the real device. Result is the same. So this is not an emulator problem.

Also not working Brightness.light:

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
    statusBarIconBrightness: Brightness.light,
  ));

When I run this code, it turns white for a few seconds and then turns black again. Like here:

enter image description here

I wonder if people who have upgraded after Flutter 2.0 have the same problem?

What is the reason for this and how to make white again?


Edit: When I flutter downgrade it turns white. The problem seems to be with flutter upgrade to 2.0. But this time when I run statusBarIconBrightness: Brightness.dark it goes black for a few seconds and turns white again. This code doesn't work at all. So Flutter 2.0 is not the reason why I can't change it to white when it is black. But the reason it's black is flutter 2.0.

like image 918
zeed Avatar asked Mar 06 '21 22:03

zeed


2 Answers

Try this

MaterialApp(
      //...
      theme: ThemeData(
        //...
        appBarTheme: AppBarTheme(brightness: Brightness.dark),
      ),
      //...
    )
like image 101
Tipu Sultan Avatar answered Sep 27 '22 16:09

Tipu Sultan


it's a bug, I saw somebody created an issue on flutter repo

meanwhile this code does fix an issue:

appBar: AppBar(
  brightness: Brightness.dark,
),
like image 33
Nagual Avatar answered Sep 27 '22 16:09

Nagual