Flutter 键盘在 ios 中不显示

auf*_*ufa 1 flutter flutter-layout

我正在 ios 模拟器中运行我的应用程序,但为什么当我单击文本字段时我的键盘突然不显示?在我修复我的应用程序图标之前,它工作得很好。

在此输入图像描述

尝试删除该应用并重新安装,但仍然不起作用。当我在 Android 上运行该应用程序并单击同一文本字段时,会显示键盘。

这是代码:

                       TextField(
                          keyboardType: TextInputType.multiline,
                          controller: inputTextController,
                          onChanged: (text) {
                              if (!_isWriting){
                                _isWriting = true;

                                  //update typing status when type messages
                                  var msg = {};
                                  msg["api_key"] = apiKey;
                                  msg["type"] = "status_typing";
                                  msg["id_sender"] = idUser;
                                  msg["id_receiver"] = idReceiver;
                                  msg["room_id"] = conversation!.roomId;
                                  String msgString = json.encode(msg);
                                  homes.channel.sink.add(msgString);

                                setState((){});
                                Future.delayed(Duration(seconds: 2)).whenComplete((){
                                  _isWriting = false;
                                  setState((){});
                                });
                              }
                            },
                          maxLines: null,
                          style: TextStyle(
                            color: Colors.black,
                          ),
                          decoration: InputDecoration(
                              contentPadding: EdgeInsets.only(top: 13, bottom: 13),
                              border: InputBorder.none,
                              hintText: 'Type a message',
                              hintStyle: TextStyle(
                                color: Color(0xff99999B),
                              )
                          ),
                        ),
Run Code Online (Sandbox Code Playgroud)

有什么解决办法吗?

Rav*_*ani 6

要在模拟器中显示键盘,请遵循此命令

cmd + shift + k
Run Code Online (Sandbox Code Playgroud)