execute abstract method

Future<void> execute({
  1. VoidCallback? onLoading,
  2. VoidValueCallback? onComplete,
  3. VoidErrorCallback? onError,
  4. VoidCallback? onFinally,
})

Asynchronously executes a computation once 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 only does the asynchronous future computation once and returns the same future's result in subsequent calls. To refresh/redo an asynchronous computation which has already been computed, use refresh.

Implementation

Future<void> execute({
  final VoidCallback? onLoading,
  final VoidValueCallback? onComplete,
  final VoidErrorCallback? onError,
  final VoidCallback? onFinally,
});