-
-
Notifications
You must be signed in to change notification settings - Fork 923
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
Initialize StateNotifierProvider Asynchronously #127
Comments
Are you looking for #57? |
Hi, thanks for this new state management solution. I think I don't need a FutureProvider because I do not need to listen to it. I will only use country list data to show as a suggestion to my country text field. |
I was referring to #57 (comment) |
oh i see. if i do that where should i call fetch? inside init state? Another thing. What does guard do? Is there a documentation for AsyncValue on how to use it? Thanks! |
No need for initState. The StateNotifierProvider is enough For AsyncValue, see its dartdoc https://pub.dev/documentation/riverpod/latest/all/AsyncValue-class.html |
Alright. thank you so much! you may close this issue. |
Additional. Can you provide a use case for each Providers in the https://riverpod.dev/? I am overwhelmed because of many Providers. hehehe! |
Each provider has its own documentation on pub https://pub.dev/documentation/riverpod/latest/all/FutureProvider-class.html I'll search for a way to make this more accessible |
Thanks Thanks! |
Closing as duplicate of #57 |
How can I initialize StateNotifierProvider asynchronously? I want to initialize a list of before creating an instance of it. The data are coming from an api. The problem is the StateNotifierProvider doesn't work in async. Here below is my code:
The text was updated successfully, but these errors were encountered: