Open ddxl123 opened 3 weeks ago
Why not initialize the controller inside the person page? Try doing that. Pass it required data via a model class, and initialize the controller inside the page or even better inject the controller.
there is a lot to say about controller management , make sure to let ChatGPT to help you with your case scenario
For example, there is a personal home page (PersonPage) with an associated PersonController. When I go to my personal home page, find my followers list, and then visit the followers’ home pages, I end up entering the PersonPage twice.
The first time I call Get.to(()=>PersonPage(userId:1)), PersonPage and PersonController are normally instantiated, and the constructor is also called. However, the second time I call Get.to(()=>PersonPage(userId:2)), PersonPage and PersonController are not recreated.
How can one ensure that each time entering PersonPage, it is a brand new instance of the personal home page for the respective user?
I tried using Get.create/Get.spawn, but I’m not sure how to use it. Could you please provide a simple and easy-to-understand example? Thank you very much!