-
Notifications
You must be signed in to change notification settings - Fork 219
-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add callbacks for AppLifecycleState's to StoreConnector #100
Comments
If you're open to adding this feature I can open a PR for it. Feel free to close the issue if not and I'll just create a separate utility for it. |
Hey hey -- sorry, somehow missed this message chain :/ Hm, I can see how this is helpful, but I think we might want to be precise about the implementation. For example, if every I could see two options:
Thanks for the suggestion! What are your thoughts? |
Hey all, Gonna close this one out for now, but happy to reopen if more folks would like this functionality! |
So far tying into application lifecycle events has been the only thing I've needed to create StatefulWidgets for. It'd be great if the StoreConnector allowed specifying suspend and resume functions that are called with the viewmodel passed to them (similar to
onInitialBuild
).Something along the lines of...
Another option would be to just add
didChangeAppLifecycleState
and have it be passed the viewmodel:The main use case I have for using these events is for activating a lock screen when the user navigates away from the app. I suspect another use case might include refreshing data when the app is resumed. Right now I'm forced to pass the store down to any widget that needs to use it in
didChangeAppLifecycleState
it via constructor parameter or useStoreProvider.of(context)
. Ideally I'd be able to use my viewmodel instead.The text was updated successfully, but these errors were encountered: