Runs task and shows ChicoBusy via showBusy / hideBusy callbacks.
Prefer ChicoContextX.showBusy from a BuildContext:
await ChicoAsync.guard(
() => api.save(),
onStart: () => context.showBusy(message: 'Saving'),
onDone: context.hideBusy,
);
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
guard<
T> (Future< T> task(), {void onStart()?, void onDone()?}) → Future<T> -
Awaits
task, always callingonDonein afinallyblock. -
result<
T> (Future< T> task()) → Future<ChicoResult< T> > -
Runs
taskand wraps the outcome in ChicoResult. -
retry<
T> (Future< T> task(), {int maxAttempts = 3, Duration delay = const Duration(milliseconds: 200), bool retryIf(Object error)?}) → Future<T> -
Retries
taskup tomaxAttemptstimes with optional backoff.