![图片[1]-Flutter 更改状态栏和导航栏颜色-IT网络技术分享](https://zywi.cn/wp-content/uploads/2022/08/搜狗截图20220821182432.png)
Widget build(BuildContext context) {
  return AnnotatedRegion<SystemUiOverlayStyle>(
    value: const SystemUiOverlayStyle(
      statusBarColor: Colors.red,//状态栏颜色
      statusBarIconBrightness: Brightness.dark, //状态栏图标颜色
      statusBarBrightness: Brightness.dark,  //状态栏亮度
      systemStatusBarContrastEnforced: true, //系统状态栏对比度强制
      systemNavigationBarColor: Colors.red,  //导航栏颜色
      systemNavigationBarIconBrightness: Brightness.dark,//导航栏图标颜色
      systemNavigationBarDividerColor: Colors.red,//系统导航栏分隔线颜色
      systemNavigationBarContrastEnforced: true,//系统导航栏对比度强制
    ),
    child: Scaffold(
      body: Text('data'),
      floatingActionButton: FloatingActionButton(
        onPressed: () {},
        child: Icon(Icons.add),
      ),
      bottomNavigationBar: Container(
        height: 50,
        width: double.infinity,
        child: Text('data'),
      ),
    ),
  );
}THE END
    








暂无评论内容