40
votes

I'm trying to build a simple login screen here using basic Textfields, but I can't get a keyboard to appear in the Simulator.
Input via the physical keyboard works just fine, but in the iOS Simulator there is no keyboard visible. Do I have to explicitly open it or something?

Feels like I'm missing something really basic here.

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; },
      )
    ],
  ),
);
}

Solution Turns out if the hardware keyboard is connected, it will suppress the software keyboard. cmd + shift + k disconnects the hardware keyboard or cmd + k toggles the software keyboard.

1
Normally this should work out of the box. Have you tried it on a physical iOS device too?Bostrot
When the simulator pops up. press (command + k) and see if it toggles the software keyboard.devluv
@Bostrot can't try that currently, have to use the Simulator.TommyF
@croyneaus4u yes, command+k toggles the ios keyboard, but how can I have autofocus trigger it automatically?TommyF
@croyneaus4u ah, I got it, thank you! command+shift+k toggles "connect hardware keyboard" which apparently was the issue.TommyF

1 Answers

94
votes
  • CMD + Shift + K toggles connectivity of the hardware keyboard, which will open the software keyboard by default if the other one is disconnected.
  • CMD + K toggles the visibility of the software keybaord.