Flutter 错误消息底部超载了 45 像素

Flutter Error Message Bottom overloaded by 45 pixels

我想用 Flutter 创建一个登录界面。

到目前为止,这是我的代码:

Future showInformationDialog(BuildContext context) {
TextEditingController name = TextEditingController();
TextEditingController deadline = TextEditingController();
return showDialog(
    context: context,
    barrierDismissible: false,
    builder: (BuildContext context) {
      return AlertDialog(
        title: SingleChildScrollView(
          physics: NeverScrollableScrollPhysics(),
          child: Form(
            child: Column(
              children: <Widget>[
                TextFormField(
                  controller: name,
                  maxLength: 40,
                  textAlign: TextAlign.left,
                  keyboardType: TextInputType.text,
                  autocorrect: false,
                  decoration: InputDecoration(
                    labelText: 'Name der Klausur: ',
                    border: OutlineInputBorder(),
                  ),
                  // The validator receives the text that the user has entered.
                  validator: (value) {
                    if (value.isEmpty) {
                      return 'Gib den Namen der Klausur ein!';
                     }
                     return null;
                   },
                ),
                SizedBox(height: 20),
                TextFormField(
                  controller: deadline,
                  maxLength: 8,
                  textAlign: TextAlign.left,
                  keyboardType: TextInputType.datetime,
                  autocorrect: false,
                  decoration: InputDecoration(
                    labelText: 'Deadline: ',
                    border: OutlineInputBorder(),
                  ),
                  // The validator receives the text that the user has entered.
                  validator: (value) {
                    if (value.isEmpty) {
                      return 'Gib das Datum der Klausur ein!';
                    }
                    return null;
                  },
                ),
                SizedBox(height: 20),
                DropDownFormField(
                  titleText: 'Priorität',
                  hintText: 'Bitte auswählen',
                  value: '',
                  dataSource: [
                    {
                      "display": "Niedrig",
                      "value": "Niedrig",
                    },
                    {
                      "display": "Mittel",
                      "value": "Mittel",
                    },
                    {
                      "display": "Hoch",
                      "value": "Hoch",
                    },
                  ],
                  textField: 'display',
                  valueField: 'value',
                  ),
                SizedBox(height: 20),
              ],
            ),
          ),
        ),
        actions: <Widget>[
          FlatButton(
            onPressed: () {
              return showDialog(
                context: context,
                builder: (context) {
                  return AlertDialog(
                    content: Text(name.text),

                  );
                }
              );
            },
            child: Text('Save'),
            color: Colors.blue,
          ),
          FlatButton(
            onPressed: () {
              return showDialog(
                context: context,
                builder: (context) {
                  return AlertDialog(
                    content: Text(deadline.text),
                  );
                }
              );
            },
            child: Text('Save'),
            color: Colors.blue,
          ),
        ],
      );
    });
}

当键盘打开时,它与文本字段发生冲突 -> 我收到错误消息: 底部溢出 49 像素。

可能是什么问题?

我已经尝试了所有方法,但还是卡在了这里。

SingleChildScrollViewresizeToAvoidBottomPadding: false 没有帮助我。可能我不知道如何正确使用它们。

如果有任何帮助,我将很高兴。

是我吗,还是我找不到您登录屏幕的代码?抛出错误是因为屏幕上没有足够的空间放置您的小部件。您使用的是 ListView 还是 Column?使用 ListView 可以滚动,这样如果没有足够的空间容纳内容,用户可以向下滚动以查看屏幕上没有显示的内容。