Flutter Textfield没有键盘

Tom*_*myF 13 ios dart flutter

我正在尝试使用基本的Textfields在这里构建一个简单的登录屏幕,但我无法让键盘出现在模拟器中.
通过物理键盘输入工作正常,但在iOS模拟器中没有键盘可见.我是否必须明确地打开它或什么?

感觉就像我在这里遗漏了一些非常基本的东西.

buildLoginScreen() {
return new Container(
  padding: EdgeInsets.only(left: 50.0, right: 50.0),
  child: new Column(
    children: <Widget>[
      new TextField(
        style: new TextStyle(color: Colors.white),
        autofocus: true,
        autocorrect: false,
        decoration: new InputDecoration(
          labelText: 'Login',
        ),
        onChanged: (text) { _userLoginEmail = text; },
      ),
      new TextField(
        autofocus: false,
        autocorrect: false,
        obscureText: true,
        decoration: new InputDecoration(
          labelText: 'Password'
        ),
        onChanged: (text) { _userLoginPassword = text; },
      )
    ],
  ),
);
}
Run Code Online (Sandbox Code Playgroud)

解决方案 如果硬件键盘已连接,则会抑制软键盘.cmd + shift + k断开硬件键盘或cmd + k切换软件键盘.

cre*_*not 23

  • CMD+ Shift+ K 切换硬件键盘的连接,如果另一个断开连接,默认情况下会打开软键盘.
  • CMD+ K 切换软件键盘的可见性.