美文网首页
flutter 更改状态栏颜色

flutter 更改状态栏颜色

作者: YXWKY | 来源:发表于2020-10-14 11:57 被阅读0次

flutter 中可以通过SystemChrome类通过SystemUiOverlayStyle来设置状态栏颜色,导航栏颜色等等,但是在经过实验时发现,在设置状态栏颜色时只有设置透明才可以显示成白色,代码如下:

SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(statusBarColor: Colors.transparent);
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
runApp(ChangeNotifierProvider(create: (_)=>LoginModel(),child:  MyApp()));

相关文章

网友评论

      本文标题:flutter 更改状态栏颜色

      本文链接:https://www.haomeiwen.com/subject/lqompktx.html