【发布时间】:2020-05-31 17:30:04
【问题描述】:
我有这个登录表单,当我按下第二个 RaisedButton 时,键盘出现并且显示小部件中出现问题的黄色/黑色横幅。
我想知道我应该将 Expanded 小部件放在此代码中的确切位置以避免此错误:
body: Container(
padding: EdgeInsets.symmetric(vertical: 20.0, horizontal: 50.0),
child: Form(
key: _formKey,
child: Column(
children: <Widget>[
SizedBox(height: 20.0),
TextFormField(),
SizedBox(height: 20.0),
TextFormField(),
SizedBox(height: 20.0),
RaisedButton(),
SizedBox(height: 12.0),
Text(''),
RaisedButton(),
),
],
),
),
),
【问题讨论】:
-
将
resizeToAvoidBottomInset: false添加到您的根Scaffold。 @亚历克斯阿里 -
谢谢@T.TSage ...确实比使用Expanded容易得多