Replies: 3 comments 8 replies
-
Hi @rrousselGit, could you just quickly let me know about this? Very appreciated. |
Beta Was this translation helpful? Give feedback.
-
You can avoid the loading flash by setting |
Beta Was this translation helpful? Give feedback.
-
Thanks @AhmedLSayed9 for your reply. If I set that |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a typical AsyncNotifier and widget to perform some async operations.
When doing these async operations, like updating something in my data base, I emit an "AsyncValue.loading()" in the notifier to show a CircularProgressIndicator() and after that I perform the operation itself inside an "AsyncValue.guard()". In the build() method of my widget I have something like this:
As per the title of this post, I'd like to only show the CircularProgressIndicator() if the async operation takes a minimum time to avoid that weird flash if the operation only takes some milliseconds.
At the moment I am able to do it by using the timeout() function. I have these functions in my AsyncNotifier:
And then in the widget I trigger the async operation like this:
This works but the problem is I don't know how to do it for all my providers without writing the asyncOp() in every of them.
Does Riverpod have some built-in functionality for this that I'm missing? How do you normally handle this?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions