【发布时间】:2021-02-16 19:36:51
【问题描述】:
这里是代码[在此处输入图片描述[][1]][1]
嘿,我正在开发一个新的应用程序,它有一个评论部分显示我把文本字段放在底部是因为更好的视图但是每当我打开键盘时我的半屏就会隐藏起来,这非常 对用户界面不好,所以在这里我需要你的帮助,当我使 resizeToAvoidBottomInset 错误文本字段隐藏在键盘后面时
appBar: AppBar(
elevation: 0.0,
title: Text(
"Comments",
style: TextStyle(color: Colors.black),
),
),
body: Column(children: [
Expanded(
child: Obx(
() => ListView.builder(
itemCount: controller.comments.length,
itemBuilder: (BuildContext context, int index) {
return Comment(
comment: controller.comments[index]['comment'],
userid: controller.comments[index]['userid']);
}),
),
),
Spacer(),
Container(
height: 50,
child: CupertinoTextField(
controller: controller.postComment,
padding: const EdgeInsets.all(8),
prefix: IconButton(
onPressed: () {},
icon: Icon(Icons.emoji_emotions),
),
// decoration: BoxDecoration(border: Border.all()),
suffix: IconButton(
icon: Icon(Icons.send),
onPressed: () {
controller.addComment(
args, FirebaseAuth.instance.currentUser.uid);
},
),
placeholder: "Enter a Comment",
),
)
]),
); ```
[1]: https://i.stack.imgur.com/FER2u.png
【问题讨论】: