skip to Main Content

I am trying to change the System Navigation Bar Color in my app with below code.

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: Colors.white,));

I am able to change it but when i navigate to other screen it changes back to its original color which is black and white color is not showing again unless i reload the app. How to fix it.

2

Answers


  1. enter image description here

    After flutter 3.1+ you can directly add navigation bar theme into your main themedata, but please check useMaterial3 : true property to use that theme

    Login or Signup to reply.
  2. Initialize that code at start in home page or where your app starts

     @override
     void initState() {
       super.initState();
       SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
         systemNavigationBarColor: Colors.white,
       ));
     }
    

    this will apply it globally

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search