键盘出现时颤动溢出底部

San*_*liz 3 mobile android overflow ios flutter

我收到此错误,我不明白为什么,在新屏幕中,我在顶部有一个简单的表单(列的开头),当我聚焦文本字段时,键盘出现并溢出日期选择和按钮,但我不知道为什么。

这是没有关注文本字段的初始状态 在此输入图像描述

这是我聚焦文本字段的时候。 在此输入图像描述

这是我必须执行此操作的小部件。

return Scaffold(
  body: SafeArea(
      child: Column(
    children: <Widget>[
      TopBarWidget(page: 'New Event', title: 'Nuevo Evento'),
      Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            TextField(
              onChanged: (value) {
                eDisplayName = value;
              },
              maxLength: 18,
              keyboardType: TextInputType.text,
              textCapitalization: TextCapitalization.sentences,
              cursorColor: Color(0xFFFC4A1A),
              decoration: InputDecoration(
                labelText: "Nombre del Evento",
                fillColor: Colors.white,
                border: new OutlineInputBorder(
                  borderRadius: new BorderRadius.circular(5.0),
                ),
              ),
            ),
            SizedBox(
              height: 16.0,
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: <Widget>[
                OutlineButton(
                  focusColor: Theme.of(context).primaryColor,
                  highlightedBorderColor: Theme.of(context).primaryColor,
                  borderSide: BorderSide(
                    color: Theme.of(context).primaryColor,
                  ),
                  textColor: Theme.of(context).primaryColor,
                  onPressed: () => _selectDate(context),
                  child: Text('Cambiar Fecha'),
                ),
                Text(
                  "${formatedDate(selectedDate.toLocal())}",
                  style: TextStyle(
                      fontSize: 18.0,
                      fontWeight: FontWeight.w500,
                      color: Theme.of(context).primaryColor),
                ),
                // Text("${selectedDate.toLocal()}"),
              ],
            ),
            SizedBox(
              height: 16.0,
            ),
            RaisedButton(
              disabledColor: Colors.grey[200],
              disabledTextColor: Colors.black,
              color: Theme.of(context).primaryColor,
              textColor: Colors.white,
              shape: RoundedRectangleBorder(
                  borderRadius: new BorderRadius.circular(10.0)),
              onPressed: eDisplayName.length == 0
                  ? null
                  : () {
                      // print(newEvent);
                      Navigator.pop(context);
                    },
              child: Text(
                'ACEPTAR',
                // style: TextStyle(fontSize: 20),
              ),
            ),
          ],
        ),
      ),
    ],
  )),
);
Run Code Online (Sandbox Code Playgroud)

enc*_*bos 7

你可以resizeToAvoidBottomInset在你的Scaffold()

像这样

return Scaffold(
  resizeToAvoidBottomInset: false,
  body: // ...
  // ...
)
Run Code Online (Sandbox Code Playgroud)

文档参考:Scaffold - resizeToAvoidBottomInset