Flutter 即使我使用了安全区域,容器1也不会';屏幕底部没有偏移,这在边缘弯曲的手机中看起来更糟

Flutter 即使我使用了安全区域,容器1也不会';屏幕底部没有偏移,这在边缘弯曲的手机中看起来更糟,flutter,dart,Flutter,Dart,即使我使用安全区域,情况也是如此: //容器1 ], ),//列 ),//安全区 ),//脚手架 ); //材料应用 } }您尚未指定安全区域的限制,请尝试以下操作: home: Scaffold( backgroundColor: Colors.redAccent, body: SafeArea( top :true, bottom :true, left :true, rig

即使我使用安全区域,情况也是如此:

//容器1 ], ),//列 ),//安全区 ),//脚手架 ); //材料应用 }
}

您尚未指定安全区域的限制,请尝试以下操作:

home: Scaffold(
        backgroundColor: Colors.redAccent,
        body: SafeArea(
          top :true,
          bottom :true,
          left :true,
          right:true,
          child: Column(
            verticalDirection: VerticalDirection.up,
            children:[
              Container(
                height: 100,
                width: 100,
                color: Colors.white,
                child: Text("Container 1"),
              ),

SafeArea用于避免操作系统的入侵(默认情况下)。底部曲线不被操作系统视为入侵,因此,它不会解决您的目的。 通过在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"),
          ),
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"),
          ),