[英]Flutter Sliver AppBar leading color
This is a Sliver AppBar.这是一个 Sliver AppBar。
How can I change the color of the back arrow?如何更改后退箭头的颜色?
BUT I don't want to set leading: Icon(Icons.arrow_back, color: Colors.red)
since (I believe) that the Sliver AppBar has the nice property of adapting the lead icon depending on context.但我不想设置
leading: Icon(Icons.arrow_back, color: Colors.red)
因为(我相信)Sliver AppBar 具有根据上下文调整前导图标的好特性。
wrap the SliverAppBar widget with Theme widget, and change primaryIconTheme color in ThemeData.用 Theme 小部件包装 SliverAppBar 小部件,并更改 ThemeData 中的 primaryIconTheme 颜色。 Here's the code:
这是代码:
Theme(
data: ThemeData(
primaryIconTheme: IconThemeData(color: Colors.red)),
child: SliverAppBar(),
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.