我想在我的 flutter 应用程序中更改后退按钮的颜色。
这是我目前所拥有的:Screenshoot
我想将颜色从浅蓝色更改为白色。我在网上搜索过,但一无所获。这是我的代码(注意我的按钮是自动创建的)
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
heroTag: 'menupage',
transitionBetweenRoutes: false,
middle: Text(
'Menu Page',
style: kSendButtonTextStyle,
),
),
提前谢谢了 !
最佳答案
我解决了设置 CupertinoTextThemeData ...
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoApp(
theme: CupertinoThemeData(
primaryColor:
Colors.white, //change color of the BOTTOM navbar icons when selected
textTheme: CupertinoTextThemeData(
primaryColor:
Colors.white, //change color of the TOP navbar icon
感谢卢卡斯为我指明了正确的方向
关于flutter - 如何在 Flutter 中更改 CupertinoNavigationBar 中后退按钮的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57826933/