【发布时间】:2020-10-04 07:00:45
【问题描述】:
return MaterialApp(
theme: ThemeData.dark().copyWith(
textTheme: GoogleFonts.dancingScriptTextTheme(
Theme.of(context).textTheme,),
),
如您所见,我在 Flutter 应用程序中使用了 danceScriptTextTheme。但是使用这个 textTheme 只会改变应用程序主体中的 textSytle。如屏幕截图所示,AppBar 中的字体不受影响。如何更改 appBar 的字体?详细解释一下。
【问题讨论】:
-
Appbar有自己的文本主题,试试在copyWith方法中添加appBarTheme: AppBarTheme(textTheme: //你想要的textTheme)
标签: android android-studio flutter visual-studio-code flutter-text