设置全面屏
使用 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, ));