refresh method
Future<void>
refresh({
- VoidCallback? onLoading,
- VoidValueCallback? onComplete,
- VoidErrorCallback? onError,
- VoidCallback? onFinally,
Asynchronously executes a computation with listener callbacks in parameters for the asynchronous computation that may fail into something that is safe to read.
This is useful to avoid having to do a tedious try/catch/then
.
This does the asynchronous future computation once but on subsequent calls, it reruns the asynchronous computation. To get the completed result from last execution, use execute.
Implementation
Future<void> refresh({
final VoidCallback? onLoading,
final VoidValueCallback? onComplete,
final VoidErrorCallback? onError,
final VoidCallback? onFinally,
}) {
buildAsyncValue();
return execute(
onLoading: onLoading,
onComplete: onComplete,
onError: onError,
onFinally: onFinally,
);
}