ThemeData-不建议使用的标题参数

问题描述 投票:0回答:1

我试图找到以下问题的答案:“如何正确编码ThemeData的已贬值的'title'参数? (我正在学习教程)。但是,我在其他主题的一些评论中找到了正确的答案。我将答案留在下面,以供将来参考和轻松查找。

theme: new ThemeData(
  primaryTextTheme: TextTheme(
      title: TextStyle(
color: Colors.white,
))),

How to change text color of AppBar, icon color of FAB universally using theme?

eMarine的回答:https://stackoverflow.com/users/1584407/emarine

flutter dart
1个回答
0
投票

将“标题”替换为“ headline6”:

theme: new ThemeData(
  primaryTextTheme: TextTheme(
      headline6: TextStyle(
color: Colors.white,
))),
© www.soinside.com 2019 - 2024. All rights reserved.