0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[素人向け] キーボードを閉じる際にリビルドされる原因の一つ

Posted at

#画面タップでフォーカス解除をしている場合(私的備忘録)

※素人が同じく素人向けに情報をシェアすることを目的にこの記事を書いています。

##経緯
私(素人)は、TextFieldのFocusを画面のどこかをタップすると、解除される方法を探しているとき、

ウィジェットの上の方で、GestureDetectorでFocusScope.of(context).unfocus()すればいいよ

というのを目にして、ただそれだけを鵜呑みして、コードを追加しました。

その後、キーボードを開く/閉じる際に、ほぼ全体がリビルドされていることに気づきました。

##どうする

今のところは、画面のどこかをタップしてFocus解除を諦める以外、私は知らないです。

誰かが、解決案を出していることを願います。

##続き
解決案が見つかれば更新予定。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?