LoginSignup
1
1

More than 3 years have passed since last update.

[Flutter]TextFormFIeldを再初期化する方法

Posted at

結論

TextFormField(
  key: Key(count),
  initialValue: count,
  ...
)

keyを変更することで、別ウィジェット扱い(差分扱い)にして再描画させている。

終わりに

reactにおけるredux-formのreinitializeみたいなことをしてほしいだけなんだけど、もっときれいなやり方ないのかな。

参考

TextFormField not resetting its Initial Value

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