简体   繁体   English

Flutter:AppBar、返回按钮、状态栏颜色

[英]Flutter: AppBar, Back Button, Status Bar color

I don't know how this happened, but somehow the colors of my app changed and I didn't even change anything by myself.我不知道这是怎么发生的,但不知何故我的应用程序的颜色发生了变化,我自己甚至没有改变任何东西。 So at first everything was black (status bar, AppBar title, Back button, etc.) and now it's all white.所以起初一切都是黑色的(状态栏、AppBar 标题、后退按钮等),现在全是白色的。 I already changed iconTheme and primaryColor in the main.dart but it doesn't work.我已经改变了iconThemeprimaryColormain.dart,但它不工作。 Can you please help me out?你能帮我一下吗? Thank you so much!非常感谢!

Try Defining the Theme of the application in main.dart.尝试在 main.dart 中定义应用程序的主题。 You could customize to any choice of Colour combinations, themes, fonts, and font sizes.您可以自定义任何颜色组合、主题、字体和字体大小。

Theme() and ThemeData() would help you out in that I feel. Theme() 和 ThemeData() 会帮助你解决我的感受。

In the following code below i've just set a constant font theme throughout the app.在下面的代码中,我只是在整个应用程序中设置了一个常量字体主题。 But theres more you can do and find out yourself.但是你可以做更多的事情并找到自己。

 theme: ThemeData(
            textTheme: GoogleFonts.latoTextTheme(Theme.of(context).textTheme)),

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM