Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

flutter - How to change the status bar text color on Ios

I am new to all this flutter thing. I searched everywhere to find a solution for this little problem. Is there a way to change the status bar color? Also when i use the a color like colors.blue i can see that the quality of the text in the status bar isn't good.

Thanks

enter image description here

appBar: AppBar(
    elevation : 0.0,
    leading: IconButton(
      icon: Icon(Icons.menu),
      tooltip: 'Navigation menu',
      onPressed: null,
    ),
    actions: <Widget>[
      IconButton(
        icon: Icon(Icons.search),
        tooltip: 'Search',
        onPressed: null,
      ),
    ],
  ),
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

@Antoine Basically you can set your theme Brightness, or you can manually override the appbar brightness using the following :

appBar: new AppBar(
  title: new Text(widget.title),
  brightness: Brightness.light, // or use Brightness.dark
),

Do note that this will only switch between white and black status text color.

.dark will make the status bar text WHITE, while .light will make the status bar text BLACK.

Maybe for a more custom color, like the comment said you can view SystemChrome class.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...