在我的根文件中,我有:
theme: ThemeData(
appBarTheme: AppBarTheme(
textTheme: TextTheme(
button: TextStyle(color: Colors.white),
),
),
),
在我的自定义 AppBar 文件中:
return AppBar(
automaticallyImplyLeading: false,
backgroundColor: Colors.transparent,
actions: <Widget>[
TextButton(
child: Text('Sign in'),
onPressed: () {},
),
],
);
但文本仍然是默认的浅蓝色。