这篇文章主要介绍了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),
));
}
前后效果对比如下:
到此这篇关于Flutter 实现整个App变为灰色的方法示例的文章就介绍到这了,更多相关Flutter App变为灰色内容请搜索编程学习网以前的文章希望大家以后多多支持编程学习网!
沃梦达教程
本文标题为:Flutter 实现整个App变为灰色的方法示例
基础教程推荐
猜你喜欢
- Android自定义View验证码输入框 2023-02-04
- android: targetSdkVersion升级中Only fullscreen activities can request orientation问题的解决方法 2022-11-05
- Android socket如何实现文件列表动态访问 2023-04-05
- Android Kotlin使用SQLite案例详解 2023-04-16
- iOS如何去掉导航栏(UINavigationBar)下方的横线 2023-03-07
- Android自定义View实现地铁显示牌效果 2023-01-01
- Android Studio实现下拉列表效果 2023-05-23
- 详解ios11中estimatedRowHeight属性 2023-04-24
- iOS输入框的字数统计/最大长度限制详解 2023-06-03
- 如何在iOS中高效的加载图片详解 2023-07-02
