像这样使用安全区域
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text("Payment Method"),
centerTitle: true,
leading: IconButton(
icon: Icon(
Icons.navigate_before,
size: 40,
),
onPressed: () {
Navigator.of(context).pop();
},
),
),
body: RefreshIndicator(
-----)
我将它用于状态栏
void main() {
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.dark,
systemNavigationBarColor: Colors.white,
systemNavigationBarIconBrightness: Brightness.dark,
systemNavigationBarDividerColor: Colors.transparent,
));runApp(MyApp());}
但是现在发生的事情是由于应用程序栏的升高,应用程序栏和状态栏似乎是分开的,所以最好的解决方法是使应用程序栏和状态栏似乎合并