You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
get: ^5.0.0-release-candidate-9.2
The text was updated successfully, but these errors were encountered:
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.
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!
The text was updated successfully, but these errors were encountered: