LoginSignup
0
0

More than 1 year has passed since last update.

【Flutter】iOSでキーボードが消えない時の対処法

Posted at

結論から書くとGestureDetectorの中にキーボードが表示される設定をしているViewを入れてあげればOKです。

ソースはこちら。

GestureDetector(
  onTap: () => FocusScope.of(context).unfocus(),
  child:  Widget
)

もしTextFormFieldなどの集合体のViewを作成している場合、その集合体のViewに上記を入れましょう。

共通化してるTextFormFieldなどのクラスに上記を入れるとそのView上では機能しますが、それ以外のViewではそれ以外の場所をタップした時にうまく動作しないなどの問題が出る可能性があるからです。

参考までに。

0
0
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
0
0