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

标签 flutter dart

我试图找到以下问题的答案:“如何正确编码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

最佳答案

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

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

关于flutter - ThemeData-不建议使用的标题参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61312511/

相关文章:

dart - Dart reader.on.loadEnd错误

javascript - 粘贴到 Canvas 中

flutter - Flutter-如何在streambuilder中使用await?

flutter - 使用 flutter 动画显示或隐藏小部件

Dart 代码在我的 Flutter 应用程序中表现不同。列表<动态 >' is not a subtype of type ' 列表< map <字符串,动态>>

flutter - 如何在 flutter 中重新创建单个小部件并使其失去状态?

arrays - 在Flutter中解析复杂的json时遇到问题

constructor - 如何使用工厂构造函数在 Dart 中实现单例模式?

firebase - Flutter - 如何在从 firebase 实时数据库中获取数据时检查多个条件?

flutter - 请帮助我从这段代码中理解 fromMap 和 toMap ?