1
1

More than 1 year has passed since last update.

Flutter Mac iOSデバッグ時にシュミレーターでキーボードを表示&入力指定

Posted at

普段実機でデバッグ作業をしていると、エディタのiOSシュミレーターで検証をお願いされた時、テキストフォーム入力時にあれ? シュミレーター上でキーボードが出ない。。。なんてことがあります。

しばらく使っていなかったせいか、iOSシュミレーターのデフォルトではMac本体のキーボードが指定されているので

command + shift + K

を同時押しすることで切り替えて出現させることを忘れていました。

スクリーンショット 2022-10-05 12.08.57.png
スクリーンショット 2022-10-05 12.25.24.png
こんな感じでかな入力で表示されます。

表示されたキーボードはTextInputTypeを利用しアルファベットや数値入力が指定できます。

new TextField(
    keyboardType: TextInputType.name,
    )

スクリーンショット 2022-10-05 12.31.21.png

new TextField(
    keyboardType: TextInputType.datetime,
    )

スクリーンショット 2022-10-05 12.42.47.png

new TextField(
    keyboardType: TextInputType.emailAddress,
    )

スクリーンショット 2022-10-05 12.48.03.png

new TextField(
    keyboardType: TextInputType.text,
    )

スクリーンショット 2022-10-05 12.50.35.png

new TextField(
    keyboardType: TextInputType.phone,
    )

スクリーンショット 2022-10-05 12.53.28.png
逆にnoneにする事で表示させなくすることもできます。

new TextField(
    keyboardType: TextInputType.none,
    )

スクリーンショット 2022-10-05 12.56.39.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1