Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 getx 进行状态管理。键入文本或显示 textFormField 的错误消息后,我导航到另一个屏幕。当我导航回这个屏幕时,我想清除文本输入和错误消息,因为这个屏幕没有被处理,它只是停用,但我意识到 getx 没有停用方法。所以我不知道如何处理它。请帮忙。
当您使用 Getx 状态管理时,请使用 onClose() 而不是 dispose()
Navigator.of(context).pop(_textEditingController.text);
只需使用您的输入值导航。