小工具知识网

当前位置: 首页 > 行业知识 > flutter 设置全屏 和隐藏状态栏和导航栏

行业知识

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

2026-10-30 23:37:57 来源:互联网转载

设置全面屏

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

SafeArea(    top: false,    bottom: false,    child: Container(       child: _body(),    ),),

隐藏状态栏和导航栏

SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);

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

SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [

SystemUiOverlay.bottom]);

设置状态栏为透明

  var brightness =        !kIsWeb && Platform.isAndroid ? Brightness.dark : Brightness.light;    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(      statusBarColor: Colors.transparent,      statusBarBrightness: brightness,      statusBarIconBrightness: brightness,    ));

上一篇:塔式服务器怎么多开端口?

下一篇:怎么修改outlook服务器端口?