Flutter 键盘隐藏文本字段-颤振

Flutter 键盘隐藏文本字段-颤振,flutter,keyboard,widget,Flutter,Keyboard,Widget,我制作了一个包含标题的聊天页面,一个消息流和一个行,其中包括文本字段和提升按钮。我已经检查了GitHub和StackOverflow中关于这个问题的每一页,但是我没有找到任何解决方案。当键盘启动时,该行不会向上移动,而是越过屏幕的底部,隐藏所有内容 有人能帮我弄清楚吗?我什么都试过了 这是我的脚手架: Widget build(BuildContext context) { return GestureDetector( onTap: (){ FocusS

我制作了一个包含标题的聊天页面,一个
消息流
和一个
,其中包括
文本字段
提升按钮
。我已经检查了GitHub和StackOverflow中关于这个问题的每一页,但是我没有找到任何解决方案。当键盘启动时,该行不会向上移动,而是越过屏幕的底部,隐藏所有内容

有人能帮我弄清楚吗?我什么都试过了

这是我的
脚手架

  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: (){
        FocusScope.of(context).requestFocus(new FocusNode());
      },
      child: Scaffold(
        resizeToAvoidBottomInset: true,
        backgroundColor: Colors.lightGreenAccent,
        appBar: new AppBar(
          backgroundColor: Colors.lightGreenAccent,
          elevation: 0,
          leading: IconButton(
            icon: Icon(Icons.arrow_back_ios, color: Colors.white),
            onPressed: () => Navigator.of(context).pop(),
          ),
          centerTitle: true,
          title: Image(
            image: iconApp,
            height: 50,
            width: 50,
          ),
        ),
        body: SafeArea(
          child: Column(
            children: <Widget>[
              SizedBox(height: 10),
              Expanded(
                child: Container(
                  width: double.infinity,
                  decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.only(topLeft: Radius.circular(30.0),
                        topRight: Radius.circular(30.0)),
                  ),
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: <Widget>[
                      Material(
                        borderRadius: BorderRadius.only(topLeft: Radius.circular(30.0),
                        topRight: Radius.circular(30.0)),
                        color: grayWhite,
                        elevation: 2,
                        child: Padding(
                          padding: const EdgeInsets.only(bottom:10),
                          child: Row(
                            children: <Widget>[
                              Padding(
                                padding: const EdgeInsets.only(top: 10.0, left: 15),
                                child: CircleAvatar(
                                  child: Image.network(
                                  ),
                                ),
                              ),
                              Container(
                                child: Column(
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: <Widget>[
                                    Padding(
                                      padding: const EdgeInsets.only(top: 10, left: 15),
                                      child: Text(
                                        "Test",
                                        style: TextStyle(
                                            color: Colors.black54,
                                            fontSize: 20
                                        ),
                                      ),
                                    ),
                                    Padding(
                                      padding: const EdgeInsets.only(top: 3, left: 15),
                                      child: Text(
                                       "Test2",
                                        style: TextStyle(
                                            color: Colors.black54,
                                            fontSize: 15
                                        ),
                                      ),
                                    ),
                                    Container(
                                      height: 1,
                                      color: Colors.white70,
                                    )
                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      MensagensStream(),
                      Row(
                        children: <Widget>[
                          Expanded(
                            child: Padding(
                              padding: const EdgeInsets.all(8.0),
                              child: TextField(
                                controller: textEditingController,
                                autofocus: true,
                                autocorrect: true,
                                onChanged: (value) {
                                  mensagem = value;
                                },
                                decoration: InputDecoration(
                                    border: OutlineInputBorder(
                                      borderRadius: BorderRadius.circular(30.0),
                                    ),
                                    hintText: "Digite a sua mensagem..."
                                ),
                              ),
                            ),
                          ),
                          ButtonTheme(
                            height: 55,
                            minWidth: 10,
                            child: RaisedButton(
                              shape: RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(
                                    100,
                                  )
                              ),
                              color: Colors.lightGreenAccent,
                              child: Icon(Icons.send, color: Colors.white),
                              onPressed: () => {
                                textEditingController.clear(),
                                firestore.collection('mensagens').add({
                                  'Mensagem': mensagem,
                                  'Remetente': googleEmail,
                                  'Destinatario': "patio@teste.com",
                                  'DataHorario': FieldValue.serverTimestamp(),
                                })
                              },
                            ),
                          ),
                        ],
                      )
                    ],
                  ),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}```
小部件构建(构建上下文){
返回手势检测器(
onTap:(){
FocusScope.of(context).requestFocus(newfocusnode());
},
孩子:脚手架(
resizeToAvoidBottomInset:true,
背景颜色:Colors.lightGreenAccent,
appBar:新的appBar(
背景颜色:Colors.lightGreenAccent,
海拔:0,
领先:IconButton(
图标:图标(Icons.arrow\u back\u ios,颜色:Colors.white),
onPressed:()=>Navigator.of(context.pop(),
),
标题:对,
标题:图像(
图片:iconApp,
身高:50,
宽度:50,
),
),
正文:安全区(
子:列(
儿童:[
尺寸箱(高度:10),
扩大(
子:容器(
宽度:double.infinity,
装饰:盒子装饰(
颜色:颜色,白色,
borderRadius:仅限borderRadius(左上角:半径.圆形(30.0)),
右上角:半径。圆形(30.0)),
),
子:列(
mainAxisAlignment:mainAxisAlignment.start,
儿童:[
材料(
borderRadius:仅限borderRadius(左上角:半径.圆形(30.0)),
右上角:半径。圆形(30.0)),
颜色:灰白色,
标高:2,
孩子:填充(
填充:仅限常量边集(底部:10),
孩子:排(
儿童:[
填充物(
填充:仅限常量边集(顶部:10.0,左侧:15),
孩子:圆环星(
孩子:Image.network(
),
),
),
容器(
子:列(
crossAxisAlignment:crossAxisAlignment.start,
儿童:[
填充物(
填充:仅限常量边集(顶部:10,左侧:15),
子:文本(
“测试”,
样式:TextStyle(
颜色:颜色。黑色54,
尺寸:20
),
),
),
填充物(
填充:仅限常量边集(顶部:3,左侧:15),
子:文本(
“测试2”,
样式:TextStyle(
颜色:颜色。黑色54,
尺寸:15
),
),
),
容器(
身高:1,,
颜色:颜色。白色70,
)
],
),
)
],
),
),
),
MensagensStream(),
划船(
儿童:[
扩大(
孩子:填充(
填充:常数边集全部(8.0),
孩子:TextField(
控制器:textEditingController,
自动对焦:对,
自动更正:正确,
一旦更改:(值){
mensagem=价值;
},
装饰:输入装饰(
边框:大纲输入边框(
边界半径:边界半径。圆形(30.0),
),
hintText:“这是一个简单的策略…”
),
),
),
),
钮扣(
身高:55,
最小宽度:10,
孩子:升起按钮(
形状:圆形矩形边框(
borderRadius:borderRadius.circular(
100,
)
),
颜色:颜色。浅绿色口音,
子项:图标(Icons.send,颜色:Colors.white),