问题描述
我正在编写带有波动的应用程序。但是以某种奇怪的方式,当我打开我的应用程序时,android statusbar隐藏了。我不要为什么会发生这种情况?
这是我要实现的目标: Goal
这就是我所拥有的: My App Screenshot
解决方法
感谢您的快速解答。可悲的是我已经这样做了:
@override
Widget build(BuildContext context) {
return Scaffold(
key: _scaffoldKey,body: SafeArea(
child: Center(
child: ListView(
shrinkWrap: true,children: [
Center(
child: Text(
_pageTitle,style: Theme.of(context).textTheme.headline1,),Center(child: Text(_pageSubTitle)),loginForm(context),],);
}
但是可惜它不起作用work
我还在主函数中设置了系统值:
void main() {
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: MAIN_LIGHT_GREEN,// navigation bar color
statusBarColor: MAIN_LIGHT_GREEN,statusBarIconBrightness: Brightness.dark,systemNavigationBarIconBrightness: Brightness.light,statusBarBrightness: Brightness.light,));
runApp(MyApp());
}
,
显示状态栏:-
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
显示透明状态栏:-
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent,));