How to put a async provide back in the loading state when refreshing data? #3708
Unanswered
chris-otani
asked this question in
Q&A
Replies: 1 comment
-
I figured it out you can check the AyncValue object from the provider if it is in the "isRefreshing" state and return the circular pogress indicator. Does anyone know how to do this in the switch statement to clean up the code?
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've reviewed the pull to refresh case study and it works but is not the exact behavior that I am looking for. I want to force a provide to refresh and show the loading state with the press of a button.
If I use "ref.refresh(activityProvider.future)" for the button press, the provider does update with new data, but the
AsyncLoading()
state does not appear to be triggered, so my loading spinner does not show.Any suggestions for how to trigger the loading spinner when refreshing the provider?
https://riverpod.dev/docs/case_studies/pull_to_refresh
Beta Was this translation helpful? Give feedback.
All reactions