关键:
1.使用SafeArea保持内容在安全显示区域内
2.MediaQuery.of(context).padding.bottom获取底部安全区域高度
3.遮挡住由于显示到抬高了显示区域在底部出现的透明或半透明
dart
Scaffold(
extendBody: true,
body: Stack(
alignment: Alignment.bottomCenter,
children: [
SizedBox(
///主体内容
),
//覆盖底部有手势区域的背景色
Container(
width: Utils().screenWidth(context),
color: Colors.white,
height: MediaQuery.of(context).padding.bottom,
),
SafeArea(
child: _bottomView()//底部导航栏布局
)
],
)
)