Flutter - How to set status bar color when AppBar not present

后端 未结 17 818
孤城傲影
孤城傲影 2020-12-07 23:56

How to set status bar color when AppBar not present.

I have tried this but not working.

Widget build(BuildContext context) {
    SystemChrome.setSys         


        
17条回答
  •  无人及你
    2020-12-08 00:51

    The status bar colour is rendered by the Android system. Whether that can be set from Flutter or not is up for debate: How to make Android status bar light in Flutter

    What you can do however, is change the status bar colour in the Android specific code by editing the theme: How to change the status bar color in android

    For iOS you'll have to see their documentation - I'm not familiar with the platform.

    There are in fact two Dart libraries, one for setting the light/dark theme of the statusbar and the other for setting the colour. I haven't used either, but clearly someone else has had the same issue you're facing and ended up developing their own package.

提交回复
热议问题