home: Scaffold(
backgroundColor: Colors.redAccent,
body: SafeArea(
child: Column(
verticalDirection: VerticalDirection.up,
children:[
Container(
height: 100,
width: 100,
color: Colors.white,
child: Text("Container 1"),
),
//容器1],
),//栏
),//安全区域
),//支架
); // Material 应用
}
}
最佳答案
设置SafeArea是为了避免操作系统入侵(默认情况下)。底部曲线不被操作系统视为入侵,因此不会解决您的目的。
您可以做些什么,以便通过向安全区域添加最少的填充来获得所需的内容:
home: Scaffold(
backgroundColor: Colors.redAccent,
body: SafeArea(
minimum: const EdgeInsets.all(16.0), //Change value according to your need
child: Column(
verticalDirection: VerticalDirection.up,
children:[
Container(
height: 100,
width: 100,
color: Colors.white,
child: Text("Container 1"),
),
关于flutter - 即使我使用了安全区域,容器1也没有偏离屏幕底部,这在带有弯曲边缘的手机中看起来更糟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63545965/