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