Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to change the color of system navigation bar?

I’m working on a flutter web application. When I run the app on a mobile device the navigation bar stays white. I’ve tried suggestions for using SystemUiOverlayStyle as below but it has not helped.

void main() async {
  SystemChrome.setSystemUIOverlayStyle(
    const SystemUiOverlayStyle(
      systemNavigationBarColor: Colors.black12,
      systemNavigationBarIconBrightness: Brightness.dark,
      statusBarColor: Colors.black12,
    ),
  );  runApp(const MyApp());
}

System Navigation Bar

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The SystemChrome.setSystemUIOverlayStyle doesn’t work on Flutter Web, it only applies to mobile platforms like Android and iOS.

for flutter web, you can manually add CSS and meta tags instead.

Try putting this in your index.html

<style>
  body {
    background-color: #FFFFFF;
  }
</style>

or

<meta name="theme-color" content="#FFFFFF" />

SystemUiOverlayStyle works by interacting with the native operating system’s UI controls, which are not present in web browsers.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading