How to change Status Bar and App Bar color in Flutter?

后端 未结 6 2051
后悔当初
后悔当初 2020-12-14 17:16

I\'m trying to change the color of system status bar to black. The configuration seems to be overridden by the AppBar class. I can achieve what I want by assigning theme: to

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 17:42

    i have achieved that way

      @override
    void initState() {
      super.initState();
      // Transparent status bar
      SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: Colors.transparent,));
    }
    

    you can also see different properties after comma

    SystemUiOverlayStyle(statusBarColor: Colors.transparent,)
    

    just use combination of ctrl + space after comma and you will get what you can use.

提交回复
热议问题