ChicoAsync class abstract final

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 calling onDone in a finally block.
result<T>(Future<T> task()) → Future<ChicoResult<T>>
Runs task and 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 task up to maxAttempts times with optional backoff.