Android studio 颤振-底部溢出230像素Stak布局

Android studio 颤振-底部溢出230像素Stak布局,android-studio,flutter,Android Studio,Flutter,有人帮我,请在这里输入图像描述 我需要为内容自动调整框的大小 我是新来的,有什么建议吗 bodyWidget(BuildContext context) => Stack( children: <Widget>[ Positioned( height: MediaQuery.of(context).size.height / 1.5, //Altura del box cone squinas redondeadas width: MediaQuery.

有人帮我,请在这里输入图像描述

我需要为内容自动调整框的大小

我是新来的,有什么建议吗

bodyWidget(BuildContext context) => Stack(

children: <Widget>[
  Positioned(
    height: MediaQuery.of(context).size.height / 1.5, //Altura del box cone squinas redondeadas
    width: MediaQuery.of(context).size.width - 20,
    left: 10.0,
    top: MediaQuery.of(context).size.height * 0.1,
    child: Card(
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(15.0),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: <Widget>[
          SizedBox(
            height: 130.0, // espacion entre el texto de la descripcion y la foto del producto
          ),
bodyWidget(BuildContext)=>Stack(
儿童:[
定位(
高度:MediaQuery.of(context).size.height/1.5,//Altura del box cone squinas redondeadas
宽度:MediaQuery.of(context).size.width-20,
左:10.0,
顶部:MediaQuery.of(context).size.height*0.1,
孩子:卡片(
形状:圆形矩形边框(
边界半径:边界半径。圆形(15.0),
),
子:列(
mainAxisAlignment:mainAxisAlignment.space,
儿童:[
大小盒子(
高度:130.0,//espacion entre el texto de la description y la foto del producto
),

使用
resizeToAvoidBottomPadding:false
。了解它。

第一种解决方案: 您通常需要在小部件的顶部提供一个滚动小部件,因为如果您试图打开键盘或更改手机的方向,Flatter需要知道如何处理小部件在屏幕上的分布

请查看此资源,您可以检查Flatter提供的各种现成选项,并为您的场景选择最佳选项

第二选项:

resizeToAvoidBottomPadding: false 
这将使错误消失

您可以查看示例代码:

appBar: new AppBar(title: new Text('Create A Parking Slot')),
      body: new Center(
          child: new SingleChildScrollView(
              child: new Container(
        margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
        color: Colors.white,
        child: new Column(children: <Widget>[
          new TextField(
            decoration: InputDecoration(labelText: "Title*"),
          ),
          new TextField(
            decoration: InputDecoration(labelText: "Available Space in Sqft*"),
          ),
          new TextField(
            decoration: InputDecoration(labelText: "Available Space*"),
          ),
          new TextField(
            decoration: InputDecoration(labelText: "Address*"),
          ),
          new TextField(
            decoration: InputDecoration(labelText: "Contact Number*"),
          ),
          new ListTile(
            title: const Text('Select Your Plan'),
            trailing: new DropdownButton<String>(
              value: "Hourly",
              onChanged: (String newValue) {
                print(newValue);
              },
              items:
                  <String>['Hourly', 'Weekly', 'Monthly'].map((String value) {
                return new DropdownMenuItem<String>(
                  value: value,
                  child: new Text(value),
                );
              }).toList(),
            ),
          ),
          new Container(
            height: 1.0,
            width: width,
            color: Colors.grey,
          ),
          new TextField(
            decoration: InputDecoration(labelText: "Rate*"),
          ),
          new UploadImage(),
          new RaisedButton(
            child: const Text('Create'),
            color: Theme.of(context).accentColor,
            textColor: Colors.white,
            elevation: 4.0,
            splashColor: Colors.blueGrey,
            onPressed: () {
              // Perform some action
              //button1(context);
            },
          )

          //
        ]),
      )))
appBar:newappbar(标题:新建文本(“创建停车位”),
正文:新中心(
子:新的SingleChildScrollView(
子容器:新容器(
边距:LTRB(10.0,20.0,10.0,10.0)的边距集,
颜色:颜色,白色,
子项:新列(子项:[
新文本字段(
装饰:输入装饰(标签文本:“标题*”),
),
新文本字段(
装饰:输入装饰(标签文本:“可用空间,单位为平方英尺*”),
),
新文本字段(
装饰:输入装饰(标签文本:“可用空间*”),
),
新文本字段(
装饰:输入装饰(标签文本:“地址*”),
),
新文本字段(
装饰:输入装饰(标签文本:“联系电话*”),
),
新ListTile(
标题:常量文本(“选择您的计划”),
拖尾:新的下拉按钮(
值:“每小时”,
onChanged:(字符串newValue){
打印(新值);
},
项目:
['Hourly'、'Weekly'、'Monthly'].map((字符串值){
返回新的DropdownMenuItem(
价值:价值,
子项:新文本(值),
);
}).toList(),
),
),
新容器(
高度:1.0,
宽度:宽度,
颜色:颜色。灰色,
),
新文本字段(
装饰:输入装饰(标签文本:“费率*”),
),
新建UploadImage(),
新升起的按钮(
子项:const Text('Create'),
颜色:主题。背景。强调颜色,
textColor:Colors.white,
标高:4.0,
颜色:颜色。蓝灰色,
已按下:(){
//执行一些操作
//按钮1(上下文);
},
)
//
]),
)))

非常感谢您,我使用了您的示例代码,我可以在我的代码中修改您的解决方案=)我无法理解此解决方案,我尝试了以下部分:body:bodyWidget(上下文),resizetoavidbottopadding:false,但它不起作用