Tue, Mar 26, 2024
Read in 1 minutes
This is a very common issue when working with Getx on flutter. Hopefully the following solution can be of a help for you.
QUESTION: I’m just navigating to a new page on Flutter, as soon as this new page/screen is closed with Get.back() or Navigator.pop(context) “MyController” onDelete() called and controller is not updating variable values properly or saving the old values.
ANSWER: You should call Get.find on the very first screen on your app, so GetX will not delete it:
YourController yourController = Get.find<YourController>();
it worked for me ✅