[英]How can I Scroll TextFiled just above the keyboard?
I have list of tasks and below that I have TextField, now when the multiple tasks added then I need to show TextField just above the keyboard.我有任务列表,下面有 TextField,现在当添加多个任务时,我需要在键盘上方显示 TextField。
How can I achieve this?我怎样才能做到这一点?
Thanks in Advance!提前致谢!
Small piece of code:一小段代码:
TextFormField(
scrollPadding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom - 160), // this line not work for me.
cursorColor: Colors.black,
toolbarOptions: ToolbarOptions(copy: true, cut: true, paste: true, selectAll: true),
showCursor: MediaQuery.of(context).viewInsets.bottom != 0 ? true : false,
style: new TextStyle(
fontSize: 15.0,
fontFamily: "Roboto",
fontWeight: FontWeight.w400,
color: darkGreyColor,
),
controller: _textFieldControllerSubTaskAdd,
focusNode: focusNodeSubTask,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.done,
onChanged: (text) {
},
),
Scaffold(
resizeToAvoidBottomInset: true,
body: SingleChildScrollView(
child: Container(
child: Column(
children: <Widget>[
TextFormField(
decoration: InputDecoration(
labelText: 'Enter Text',
),
),TextFormField(
decoration: InputDecoration(
labelText: 'Enter Text',
),
),TextFormField(
decoration: InputDecoration(
labelText: 'Enter Text',
),
),TextFormField(
decoration: InputDecoration(
labelText: 'Enter Text',
),
),TextFormField(
decoration: InputDecoration(
labelText: 'Enter Text',
),
),TextFormField(
decoration: InputDecoration(
labelText: 'Enter Text',
),
),TextFormField(
decoration: InputDecoration(
labelText: 'Enter Text',
),
),
TextFormField(
decoration: InputDecoration(
labelText: 'Enter Text',
),
)
],
),
),
)
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.