我能够设置的背景颜色的 AppBar到 Colors.amber。这会自动将文本颜色设置为黑色。我知道可访问性问题可能会出现,但无论如何,我希望文本颜色为白色。
我仍然可以设置从 AppBar的文本颜色,但我想设置它的普遍性。
这是我的应用程序的主题。
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.amber,
textTheme: Theme.of(context).textTheme.apply(
bodyColor: Colors.white,
displayColor: Colors.white,
),
),