注意:我使用 Navigator.of(context).push 来推送 ModalRoute,
您好,我的页面有 ModalRoute
和 TextFormField
在正文中,但是当键盘显示时,输入被键盘隐藏,如何解决这个问题?
return Container(
child: ListView(
children: <Widget>[
//other widget
SizedBox(height: _qtyAnimation.value),
Row(
children: <Widget>[
Expanded(
child: Text(
"Jumlah",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
SizedBox(
width: 145.0,
child: TextFormField(
focusNode: _qtyFocusNode,
controller: qty,
keyboardType: TextInputType.number,
textAlign: TextAlign.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(0.0),
prefixIcon: IconButton(
icon: Icon(Icons.remove),
onPressed: () {},
),
border: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.grey, width: 0.1),
),
suffixIcon: IconButton(
icon: Icon(Icons.add),
onPressed: () {},
),
),
),
),
],
),
],
);
这就是我的代码,我尝试使用 focusnode 等等,结果仍然相同 请帮帮我
最佳答案
感谢使用文本字段底部的填充解决了我的问题
Padding(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom));
和母马反向列表
关于dart - Flutter TextFormField 被键盘隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53586892/