flutter 设置全屏 和隐藏状态栏和导航栏

设置全面屏

使用 SafeArea 将页面套起来 top bottom 都设置为true

Dart 复制代码
SafeArea(
    top: false,
    bottom: false,
    child: Container(
       child: _body(),
    ),
),

隐藏状态栏和导航栏

复制代码
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);

overlays 中可以填需要展示的 如 填了SystemUiOverlay.bottom 就是需要展示 底部

SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [

复制代码
SystemUiOverlay.bottom

]
);

设置状态栏为透明

Dart 复制代码
  var brightness =
        !kIsWeb && Platform.isAndroid ? Brightness.dark : Brightness.light;
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
      statusBarColor: Colors.transparent,
      statusBarBrightness: brightness,
      statusBarIconBrightness: brightness,
    ));
相关推荐
●VON15 分钟前
AtomGit Flutter鸿蒙客户端:Issue管理
flutter·华为·架构·harmonyos·鸿蒙·issue
xkxnq33 分钟前
第八阶段:工程化、质量管控与高级拓展(130天),Vue端到端测试:Cypress自动化测试(登录流程+表单提交+页面跳转)
前端·vue.js·flutter
●VON3 小时前
AtomGit Flutter鸿蒙客户端:文件树与代码浏览
android·服务器·安全·flutter·harmonyos·鸿蒙
911hzh16 小时前
Flutter Plugin 开发教程:从零创建原生插件到发布 pub.dev 完整流程
flutter
我有满天星辰1 天前
【Dart 语言学习教程 】 第二章:面向对象编程
学习·flutter·dart
●VON1 天前
AtomGit Flutter鸿蒙客户端:API客户端与网络层
flutter·华为·架构·跨平台·harmonyos·鸿蒙
核电机组1 天前
IOS原生APP集成Flutter
flutter·ios
唔661 天前
在 Flutter 混合开发中,Android 原生层通知 Dart 界面更新状态
android·flutter
小书房1 天前
移动开发跨平台方案之RN/Flutter/KMP/CMP
flutter·react native·react·跨平台·rn·kmp·cmp