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
I've been meaning to standardize everything for my flutter projects. I have some thoughts regarding the User Profile State...
To keep the user state globally, I'd usually just create a ChangeNotifierProvider at the root to notifyListeners() when anything changes. Is that still a good approach when using Stacked?
If it is so, should the StackedApp implement a way to include "Global Providers" to handle global states?
I was thinking that with your approach, the UserService will be global because of Get_it at setupLocators(), but when a change is pushed, since it isn't a view model, changes wont be reflected through the app...
I think wrapping every View with a UserServiceViewModel would not be optimal...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thanks a lot for your structure!
I've been meaning to standardize everything for my flutter projects. I have some thoughts regarding the User Profile State...
To keep the user state globally, I'd usually just create a ChangeNotifierProvider at the root to notifyListeners() when anything changes. Is that still a good approach when using Stacked?
If it is so, should the
StackedApp
implement a way to include "Global Providers" to handle global states?I was thinking that with your approach, the
UserService
will be global because ofGet_it
atsetupLocators()
, but when a change is pushed, since it isn't a view model, changes wont be reflected through the app...I think wrapping every View with a
UserServiceViewModel
would not be optimal...Beta Was this translation helpful? Give feedback.
All reactions