SystemUiOverlayStyle systemUiOverlayStyle =
const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,//状态栏
systemNavigationBarColor:Color(0xffffffff),//虚拟按键背景色
systemNavigationBarDividerColor: Colors.transparent,
systemNavigationBarIconBrightness: Brightness.dark,//虚拟按键图标色
statusBarIconBrightness: Brightness.light,
statusBarBrightness: Brightness.light,
);
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
放在 main(){}最后面
在页面 里也可以修改
@override
Widget build(BuildContext context) {
SystemUiOverlayStyle systemUiOverlayStyle =
const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,//状态栏
systemNavigationBarColor:Color(0xffffffff),//虚拟按键背景色
systemNavigationBarDividerColor: Colors.transparent,
systemNavigationBarIconBrightness: Brightness.dark,//虚拟按键图标色
statusBarIconBrightness: Brightness.light,
statusBarBrightness: Brightness.light,
);
return AnnotatedRegion<SystemUiOverlayStyle>(
value: systemUiOverlayStyle, //SystemUiOverlayStyle.dark,
child: ..., //getBody
);
}