flutter 修改状态栏

获取状态栏高度

使用context:

MediaQuery.of(context).padding.top)

修改状态栏颜色

使用Appbar

appBar: AppBar(
          title: Text('appbar', style: TextStyle(color: Colors.black),),
          brightness: Brightness.light,
          backgroundColor: Colors.white,
        ),

使用 AnnotatedRegion

return AnnotatedRegion(
        value: SystemUiOverlayStyle.dark,
        child: Scaffold(
          body: Column(),
        ));

参考官方文档:修改状态栏颜色

你可能感兴趣的:(Flutter,flutter)