Flutter 实现整个App变为灰色
在Flutter中实现整个App变为灰色是非常简单的,只需要在最外层的控件上包裹ColorFiltered,用法如下:
@override
Widget build(BuildContext context) {
return ColorFiltered(
colorFilter: ColorFilter.mode(Colors.grey, BlendMode.color),
child: Scaffold(
appBar: _appBar,
body: IndexedStack(
index: _currIndex,
children: <Widget>[HomeItemPage(), WidgetPage(), MyPage()],
),
backgroundColor: Theme.of(context).backgroundColor,
bottomNavigationBar: _buildBottomNavigationBar(context),
));
}本文内容仅供个人学习/研究/参考使用,不构成任何决策建议或专业指导。分享/转载时请标明原文来源,同时请勿将内容用于商业售卖、虚假宣传等非学习用途哦~感谢您的理解与支持!