我对所有这些 flutter 的东西都不熟悉。我到处寻找解决这个小问题的方法。 有没有办法改变状态栏的颜色? 此外,当我使用 color.blue 之类的颜色时,我可以看到状态栏中的文本质量不好。
谢谢
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,
),
],
),
最佳答案
@Antoine 基本上你可以设置你的主题亮度,或者你可以使用以下手动覆盖应用栏亮度:
appBar: new AppBar(
title: new Text(widget.title),
brightness: Brightness.light, // or use Brightness.dark
),
请注意,这只会在白色和黑色状态文本颜色之间切换。
.dark
将使状态栏文本WHITE,而 .light
将使状态栏文本BLACK>.
也许是为了更自定义的颜色,就像评论说你可以查看 SystemChrome 类。
https://stackoverflow.com/questions/51709247/