ref.listen with asyncvalue #2946
-
Hello, I'm new to riverpod I'm using this code in my widget to display a snackbar when some error occurs in my asynchronous call:
If you press the button and make the call, it shows the error, but if I press it again the snackbar is shown twice, why does this happen? Is it because the state changes from true to false and the error is logged? What is the way to deal with it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Check state.isLoading |
Beta Was this translation helpful? Give feedback.
-
ref.listen(authControllerProvider, (_, state) {
|
Beta Was this translation helpful? Give feedback.
You want !state.isLoading