Flutter Getx 不会更新 TextFormField 的初始值

发布于 01-14 09:38 字数 197 浏览 3 评论 0原文

清理变量的函数

TextFormField 所在的视图

如果我在文本小部件中使用相同的变量,它可以工作,但不能在 TextFormField 上使用。

The function that cleans the variables

The view where the TextFormField is

If i use the same variable in a Text Widget it works but not on TextFormField.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

征棹2025-01-21 09:38:14

正如其名称所示,initialValue 是 TextFormField 的初始文本,使用新的 initialValue 重建 TextFormField 不会产生任何效果。您可以使用控制器代替初始值:
文章

initialValue as its name indicates is TextFormField's initial text and rebuilding TextFormField with new initialValue doesn't have any effect. you can use controller instead of initialValue:
Article

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文