Flutter ios and statusbar text color

Viewed 6597

I read dozens of questions and answers, I read a lot of articles and tried a lot of things, I can't get the status bar text of my app to be white on ios. so first here's a screen shot. enter image description here

I obviously want it white. Here is what I tried :

  1. I first tried using the theme of my CuppertinoApp, especially the brightness property
  2. I tried using SystemChrome.setSystemUIOverlayStyle to set the statusBrightness
  3. I tried using the Info.plist of my app to set the brightness, and it worked, as in, it is white during the loading, but then, it becomes black when the app really starts.
  4. I tried this package : https://pub.dev/packages/flutter_statusbarcolor and it works too for about 0,2 second, I see the text being white, and then black again.

Every test I did, I used both brightness settings to avoid any misunderstanding and every time I completely refreshed the whole app to avoid any cache problem. What am I missing ?

2 Answers

To make the text and icons white on the status bar use the below code anywhere in your code, ideally in main or in one of the top level widget's build.

  SystemChrome.setSystemUIOverlayStyle(
      SystemUiOverlayStyle(statusBarBrightness: Brightness.dark)
  );

Then re-run your app just incase to see the changes.

p.s: To make the icons dark again use Brightness.light

Related