文档
沉浸式状态栏
在main方法中添加:
1 2 3 4 5 6
| SystemChrome.setSystemUIOverlayStyle( const SystemUiOverlayStyle( statusBarColor: Colors.transparent, statusBarBrightness: Brightness.light, ), );
|
内容居中
先使用Center使x轴居中,再使用Column的mainAxisAlignment: MainAxisAlignment.center属性实现y轴居中。
1 2 3 4 5 6 7 8 9 10 11 12 13
| Scaffold( appBar: AppBar( title: const Text("New Page"), centerTitle: true, ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Obx((() => Text("Get find Controller count: ${controller.count}"))), ], )), )
|