当我使用全屏模式时:
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
这是我的代码:
return Scaffold(
body: Container(
height: height,
decoration: BoxDecoration(
color: Colors.black,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
onPressed: () {},
padding: const EdgeInsets.all(25),
iconSize: 80.sp,
icon: const Icon(
Icons.miscellaneous_services_outlined,
),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.all(18.0),
child: Consumer(
builder: (context, watch, child) {
final state = watch(loginNotifierProvider);
return Text(
state.appVersion,
style: Theme.of(context).textTheme.headline6,
);
},
),
),
],
)
],
),
),
);
但是当我将容器包裹在柱中时:
return Scaffold(
body: Column(
children: [
Container(
height: height,
decoration: BoxDecoration(
color: Colors.black,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
onPressed: () {},
padding: const EdgeInsets.all(25),
iconSize: 80.sp,
icon: const Icon(
Icons.miscellaneous_services_outlined,
),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.all(18.0),
child: Consumer(
builder: (context, watch, child) {
final state = watch(loginNotifierProvider);
return Text(
state.appVersion,
style: Theme.of(context).textTheme.headline6,
);
},
),
),
],
)
],
),
),
],
),
);
容器占据全屏,但这会导致错误:
如何去掉这个条子?
如何让应用程序全屏显示?
这是android 4.4 api 19。
用
SingleChildScrollView
代替 Column
包裹
return Scaffold(
body: SingleChildScrollView(
Container(
height: height,
decoration: BoxDecoration(
color: Colors.black,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
onPressed: () {},
padding: const EdgeInsets.all(25),
iconSize: 80.sp,
icon: const Icon(
Icons.miscellaneous_services_outlined,
),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.all(18.0),
child: Consumer(
builder: (context, watch, child) {
final state = watch(loginNotifierProvider);
return Text(
state.appVersion,
style: Theme.of(context).textTheme.headline6,
);
},
),
),
],
)
],
),
),
),
);
我正在尝试在 android 4.4.2 (api 19) 上运行我的 flutter 应用程序,但它没有运行 应用程序已安装,但打开时崩溃