首页 > 解决方案 > Flutter:更改状态栏文本颜色无法正常工作

问题描述

Stackoverflow 上提到的几乎所有 Q/A 都与同一主题相关,但没有得到适当的解决方案。

主要问题:我的应用程序的原色为蓝色,我想将状态栏文本颜色设置为白色。

我试过的:

截图:

启动画面:

在此处输入图像描述

仪表板屏幕:

在此处输入图像描述


我还检查了github 问题链接,但对我不起作用。

我只需要将状态栏文本颜色更改为白色。有什么帮助吗?

标签: flutterstatusbarflutter-themeflutter-design

解决方案


申请所有 appBar 使用

 return MaterialApp(
                theme: ThemeData(
                  appBarTheme: Theme.of(context).appBarTheme.copyWith(brightness: Brightness.dark),
                ),
                debugShowCheckedModeBanner: false,
                // home: InvoiceList(),
                home: widget());

我希望它会起作用。

谢谢你。


推荐阅读