問題
以下を参考にさせていただき、アプリの全体のフォントをGoogleFontsのキウイ丸に変更した。
しかし、AppBarのタイトルだけ、元のフォントのまま変わらない。
原因
appBarThemeでtitleTextStyleを指定していたため、そちらが優先して、デフォルトのフォントで表示されてしまったようでした。
解決方法
appBarThemeのtitleTextStyleをGoogleFonts.kiwiMaru(ここはお好きなフォント名)で囲むことで解決しました。
MaterialAppのtheme
theme: ThemeData(
primarySwatch: AppColors.mainBackColorMaterial,
appBarTheme: AppBarTheme(
titleTextStyle: GoogleFonts.kiwiMaru( //元のtextStyleをGoogleFonts.kiwiMaruで囲んだ
textStyle: const TextStyle(
color: AppColors.mainTitleTextColor,
fontWeight: FontWeight.bold,
fontSize: 25,
)),
),
textTheme: GoogleFonts.kiwiMaruTextTheme(
Theme.of(context).textTheme,
)),