我正在使用Flutter中的showAboutDialog
函数来显示项目中使用的许可证。然而,我无法改变VIEW LICENSES
和CLOSE
文本按钮的文本颜色。请参见此图片以了解详情:
这是我的代码:
...
onTap: () {
showAboutDialog(
context: context,
applicationName: 'bla',
applicationLegalese: 'November 2023',
);
},
我尝试过的是在 showAboutDialog
中寻找颜色字段,但无法找到任何东西。我假设我可以在我的 MaterialApp
的 ThemeData
中更改颜色。不幸的是,我无法找到要覆盖默认文本按钮样式的特定主题。我尝试在我的
MaterialApp
的 ThemeData
中做出以下更改,将 VIEW LICENSES
和 CLOSE
的颜色更改为绿色,但没有产生任何变化:textButtonTheme: TextButtonThemeData(style: ButtonStyle(foregroundColor: MaterialStateProperty.all<Color>(Colors.green))
对此有什么想法吗?