[Flutter-23] 状态栏修改背景色

状态栏修改背景色

  • AppBar中brightness 设置
  • brightness: Brightness.dark, // 设置状态栏的颜色,好像取反设置.
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('GridView', style: TextStyle(color: Colors.white)),
          backgroundColor: Colors.black,
          brightness: Brightness.dark, // 设置状态栏的颜色,好像取反设置.
        ),
        body: Content6(),
        backgroundColor: Colors.white,
      ),
    );
  }
}
上一篇:Flutter | 透明导航栏 AppBar


下一篇:直播系统开发,Flutter创建圆圈图标按钮