[英]How to change text color of Flutter license?
I'm new to Flutter.我是 Flutter 的新手。 How do I change the text color of the Flutter license?
如何更改 Flutter 许可证的文本颜色? Or if this is not possible, how do I override scaffoldBackgroundColor for a single screen?
或者如果这是不可能的,我如何为单个屏幕覆盖脚手架BackgroundColor?
I set my scaffoldBackgroundColor in my theme: ThemeData on the main.dart file to black.我在我的主题中设置了我的脚手架背景颜色: main.dart 文件上的 ThemeData 为黑色。
But now my Flutter License can't be read because the text has defaulted to black.但是现在我的 Flutter 许可证无法读取,因为文本默认为黑色。
I'm wondering if I can customize the text color in my flutter license or override my scaffoldBackgroundColor.我想知道是否可以自定义 flutter 许可证中的文本颜色或覆盖我的脚手架背景颜色。 I need a white scaffoldBackgroundColor in order for the Flutter license to display properly.
为了正确显示 Flutter 许可证,我需要一个白色的脚手架背景颜色。
The only issue is if I change the scaffoldBackgroundColor in my main.dart page, it of course changes it for all my other screens which is not what i want.唯一的问题是,如果我在 main.dart 页面中更改了脚手架BackgroundColor,它当然会为我所有其他屏幕更改它,这不是我想要的。 Many thanks for your help!
非常感谢您的帮助!
here is what my theme data looks like in main.dar这是我的主题数据在 main.dar 中的样子
theme: ThemeData(
primaryColor: Color(0XFFeb1555),
accentColor: Color(0XFF5173A8),
scaffoldBackgroundColor: Color(0xff1D1E33),
canvasColor: Colors.black,
textTheme: TextTheme(
bodyText2: TextStyle(
color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.bold),
),
),
I edited three specific parts of the theme data in my main.dart file.我在 main.dart 文件中编辑了主题数据的三个特定部分。 They were heading 5, bodyText2, and caption.
它们是标题 5、bodyText2 和标题。
theme: ThemeData(
primaryColor: Color(0XFFeb1555),
accentColor: Color(0XFF5173A8),
scaffoldBackgroundColor: Color(0xff1D1E33),
canvasColor: Colors.black,
textTheme: TextTheme(
headline5: TextStyle(
color: Colors.white,
),
caption: TextStyle(
color: Colors.white,
),
bodyText2: TextStyle(
color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.bold),
),
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.