async_task_extension library
extension
for AsyncTask collections.
Classes
-
AsyncLoop<
I> -
An async loop, similar to a
for
loop block. - AsyncSequenceLoop
- An async sequence loop, from i to limit (exclusive).
-
Completer<
T> - A way to produce Future objects and to complete them later with a value or error.
-
EventSink<
T> - A Sink that supports adding errors.
-
Future<
T> - The result of an asynchronous computation.
-
FutureOr<
T> -
A type representing values that are either
Future<T>
orT
. -
MultiStreamController<
T> - An enhanced stream controller provided by Stream.multi.
-
Stream<
T> - A source of asynchronous data events.
-
StreamConsumer<
S> - Abstract interface for a "sink" accepting multiple entire streams.
-
StreamController<
T> - A controller with the stream it controls.
-
StreamIterator<
T> - An Iterator-like interface for the values of a Stream.
-
StreamSink<
S> - A object that accepts stream events both synchronously and asynchronously.
-
StreamSubscription<
T> - A subscription on events from a Stream.
-
StreamTransformer<
S, T> - Transforms a Stream.
-
StreamTransformerBase<
S, T> - Base class for implementing StreamTransformer.
-
StreamView<
T> - Stream wrapper that only exposes the Stream interface.
-
SynchronousStreamController<
T> - A stream controller that delivers its events synchronously.
- Timer
- A countdown timer that can be configured to fire once or repeatedly.
- Zone
- A zone represents an environment that remains stable across asynchronous calls.
- ZoneDelegate
- An adapted view of the parent zone.
- ZoneSpecification
- A parameter object with custom zone function handlers for Zone.fork.
Extensions
- AsyncExtensionErrorLoggerExtension on AsyncExtensionErrorLogger?
-
AsyncFunctionExtension
on AsyncFunction<
R> -
AsyncFunctionExtension1
on AsyncFunction1<
R, A> -
AsyncFunctionExtension2
on AsyncFunction2<
R, A, B> -
AsyncFunctionExtension3
on AsyncFunction3<
R, A, B, C> -
AsyncFunctionExtension4
on AsyncFunction4<
R, A, B, C, D> -
AsyncFunctionExtension5
on AsyncFunction5<
R, A, B, C, D, E> -
AsyncFunctionExtension6
on AsyncFunction6<
R, A, B, C, D, E, F> -
AsyncFunctionExtension7
on AsyncFunction7<
R, A, B, C, D, E, F, G> -
AsyncFunctionExtension8
on AsyncFunction8<
R, A, B, C, D, E, F, G, H> -
AsyncFunctionExtension9
on AsyncFunction9<
R, A, B, C, D, E, F, G, H, I> - AsyncFunctionExtensionG on AsyncFunctionGeneric
-
AsyncTaskExtension
on Iterable<
T> - extension for AsyncTask Iterable.
- CompleterExtension on Completer
-
ExpandoFutureExtension
on Expando<
Future< T> > -
ExpandoFutureOrExtension
on Expando<
FutureOr< T> > - Float32x4ListExtension on Float32x4List
- Float64x2ListExtension on Float64x2List
-
FutureDoubleExtension
on Future<
double> -
FutureExtension
on Future<
T> -
FutureExtensions
on Future<
T> - Convenience methods on futures.
-
FutureIntExtension
on Future<
int> -
FutureIterable
on Iterable<
Future< T> > -
FutureIterableExtension
on Future<
Iterable< T> > -
FutureIterableNullableExtension
on Future<
Iterable< T> ?> -
FutureNonNullOnErrorExtension
on Future<
T> -
FutureNullableExtension
on Future<
T?> -
FutureNullableOnErrorExtension
on Future<
T?> -
FutureNumExtension
on Future<
num> -
FutureOnErrorExtension
on Future<
T> -
FutureOrDoubleExtension
on FutureOr<
double> -
FutureOrExtension
on FutureOr<
T> - Extension for FutureOr.
-
FutureOrIntExtension
on FutureOr<
int> -
FutureOrIterableExtension
on FutureOr<
Iterable< T> > -
FutureOrIterableNullableExtension
on FutureOr<
Iterable< T> ?> -
FutureOrNullableExtension
on FutureOr<
T?> -
FutureOrNumExtension
on FutureOr<
num> -
FutureRecord2
on (Future<
T1> , Future<T2> ) - Parallel operations on a record of futures.
-
FutureRecord3
on (Future<
T1> , Future<T2> , Future<T3> ) - Parallel operations on a record of futures.
-
FutureRecord4
on (Future<
T1> , Future<T2> , Future<T3> , Future<T4> ) - Parallel operations on a record of futures.
-
FutureRecord5
on (Future<
T1> , Future<T2> , Future<T3> , Future<T4> , Future<T5> ) - Parallel operations on a record of futures.
-
FutureRecord6
on (Future<
T1> , Future<T2> , Future<T3> , Future<T4> , Future<T5> , Future<T6> ) - Parallel operations on a record of futures.
-
FutureRecord7
on (Future<
T1> , Future<T2> , Future<T3> , Future<T4> , Future<T5> , Future<T6> , Future<T7> ) - Parallel operations on a record of futures.
-
FutureRecord8
on (Future<
T1> , Future<T2> , Future<T3> , Future<T4> , Future<T5> , Future<T6> , Future<T7> , Future<T8> ) - Parallel operations on a record of futures.
-
FutureRecord9
on (Future<
T1> , Future<T2> , Future<T3> , Future<T4> , Future<T5> , Future<T6> , Future<T7> , Future<T8> , Future<T9> ) - Parallel operations on a record of futures.
- Int32x4ListExtension on Int32x4List
-
IterableAsyncExtension
on Iterable<
T> -
IterableExtension
on Iterable<
T> -
IterableFutureExtension
on Iterable<
Future< T> > -
Extension for
Iterable<Future<T>>
. -
IterableFutureOrExtension
on Iterable<
FutureOr< T> > -
Extension for
Iterable<FutureOr<T>>
. -
IterableFutureOrExtensionNullable
on Iterable<
FutureOr< T?> > - Extensions that apply to iterables with a nullable element type.
-
IterableFutureOrNullableExtension
on Iterable<
FutureOr< T> ?> -
IterableMapEntryFutureExtension
on Iterable<
MapEntry< FutureOr< >K> , FutureOr<V> > -
IterableMapEntryFutureKeyExtension
on Iterable<
MapEntry< FutureOr< >K> , V> -
IterableMapEntryFutureValueExtension
on Iterable<
MapEntry< K, FutureOr< >V> > -
ListDoubleExtension
on List<
double> -
ListExtension
on List<
T> -
ListFloat32x4Extension
on List<
Float32x4> -
ListFloat64x2Extension
on List<
Float64x2> -
ListInt32x4Extension
on List<
Int32x4> -
ListIntExtension
on List<
int> -
MapExtension
on Map<
K, V> -
MapFutureExtension
on Map<
FutureOr< K> , FutureOr<V> > -
MapFutureKeyExtension
on Map<
FutureOr< K> , V> -
MapFutureValueExtension
on Map<
K, FutureOr< V> > -
MapFutureValueNullableExtension
on Map<
K, FutureOr< V?> > -
SetExtension
on Set<
T> - SuppressFutureUnhandledErrorExtension on Future
Properties
- defaultAsyncExtensionErrorLogger ↔ AsyncExtensionErrorLogger?
-
The default AsyncExtensionErrorLogger.
getter/setter pair
Functions
-
asyncRetry<
R> (FutureOr< R?> tryBlock(), {R? defaultValue, bool throwOnRetryExhaustion = false, int maxRetries = 3, Duration? retryDelay, Duration? computeDelay(int retry)?, bool? onError(Object error, StackTrace stackTrace, int retries)?}) → FutureOr<R?> - Executes an asynchronous operation with retry logic.
-
asyncTry<
R> (FutureOr< R?> tryBlock(), {FutureOr<R?> then(R? r)?, Function? onError, FutureOr<void> onFinally()?}) → FutureOr<R?> -
Executes a
tryBlock
with atry
,then
,catch
, andfinally
flow. -
runZoned<
R> (R body(), {Map< Object?, Object?> ? zoneValues, ZoneSpecification? zoneSpecification, Function? onError}) → R -
Runs
body
in its own zone. -
runZonedGuarded<
R> (R body(), void onError(Object error, StackTrace stack), {Map< Object?, Object?> ? zoneValues, ZoneSpecification? zoneSpecification}) → R? -
Runs
body
in its own error zone. -
scheduleMicrotask(
void callback()) → void - Runs a function asynchronously.
-
unawaited(
Future< void> ? future) → void - Explicitly ignores a future.
Typedefs
- AsyncExtensionErrorLogger = void Function(Object? e, StackTrace? s)?
-
AsyncFunction<
R> = FutureOr< R> Function() -
AsyncFunction1<
R, A> = FutureOr< R> Function(A a) -
AsyncFunction2<
R, A, B> = FutureOr< R> Function(A a, B b) -
AsyncFunction3<
R, A, B, C> = FutureOr< R> Function(A a, B b, C c) -
AsyncFunction4<
R, A, B, C, D> = FutureOr< R> Function(A a, B b, C c, D d) -
AsyncFunction5<
R, A, B, C, D, E> = FutureOr< R> Function(A a, B b, C c, D d, E e) -
AsyncFunction6<
R, A, B, C, D, E, F> = FutureOr< R> Function(A a, B b, C c, D d, E e, F f) -
AsyncFunction7<
R, A, B, C, D, E, F, G> = FutureOr< R> Function(A a, B b, C c, D d, E e, F f, G g) -
AsyncFunction8<
R, A, B, C, D, E, F, G, H> = FutureOr< R> Function(A a, B b, C c, D d, E e, F f, G g, H h) -
AsyncFunction9<
R, A, B, C, D, E, F, G, H, I> = FutureOr< R> Function(A a, B b, C c, D d, E e, F f, G g, H h, I i) - AsyncFunctionGeneric = Function
- ControllerCallback = void Function()
-
Type of a stream controller's
onListen
,onPause
andonResume
callbacks. -
ControllerCancelCallback
= FutureOr<
void> Function() -
Type of stream controller
onCancel
callbacks. - CreatePeriodicTimerHandler = Timer Function(Zone self, ZoneDelegate parent, Zone zone, Duration period, void f(Timer timer))
- The type of a custom Zone.createPeriodicTimer implementation function.
- CreateTimerHandler = Timer Function(Zone self, ZoneDelegate parent, Zone zone, Duration duration, void f())
- The type of a custom Zone.createTimer implementation function.
- ErrorCallbackHandler = AsyncError? Function(Zone self, ZoneDelegate parent, Zone zone, Object error, StackTrace? stackTrace)
- The type of a custom Zone.errorCallback implementation function.
-
ForkHandler
= Zone Function(Zone self, ZoneDelegate parent, Zone zone, ZoneSpecification? specification, Map<
Object?, Object?> ? zoneValues) - The type of a custom Zone.fork implementation function.
- HandleUncaughtErrorHandler = void Function(Zone self, ZoneDelegate parent, Zone zone, Object error, StackTrace stackTrace)
- The type of a custom Zone.handleUncaughtError implementation function.
- PrintHandler = void Function(Zone self, ZoneDelegate parent, Zone zone, String line)
- The type of a custom Zone.print implementation function.
-
RegisterBinaryCallbackHandler
= ZoneBinaryCallback<
R, T1, T2> Function<R, T1, T2>(Zone self, ZoneDelegate parent, Zone zone, R f(T1 arg1, T2 arg2)) - The type of a custom Zone.registerBinaryCallback implementation function.
-
RegisterCallbackHandler
= ZoneCallback<
R> Function<R>(Zone self, ZoneDelegate parent, Zone zone, R f()) - The type of a custom Zone.registerCallback implementation function.
-
RegisterUnaryCallbackHandler
= ZoneUnaryCallback<
R, T> Function<R, T>(Zone self, ZoneDelegate parent, Zone zone, R f(T arg)) - The type of a custom Zone.registerUnaryCallback implementation function.
-
RunBinaryHandler
= R Function<
R, T1, T2>(Zone self, ZoneDelegate parent, Zone zone, R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) - The type of a custom Zone.runBinary implementation function.
-
RunHandler
= R Function<
R>(Zone self, ZoneDelegate parent, Zone zone, R f()) - The type of a custom Zone.run implementation function.
-
RunUnaryHandler
= R Function<
R, T>(Zone self, ZoneDelegate parent, Zone zone, R f(T arg), T arg) - The type of a custom Zone.runUnary implementation function.
- ScheduleMicrotaskHandler = void Function(Zone self, ZoneDelegate parent, Zone zone, void f())
- The type of a custom Zone.scheduleMicrotask implementation function.
-
ZoneBinaryCallback<
R, T1, T2> = R Function(T1, T2) -
ZoneCallback<
R> = R Function() -
ZoneUnaryCallback<
R, T> = R Function(T)
Exceptions / Errors
- AsyncError
- An error and a stack trace.
- DeferredLoadException
- Thrown when a deferred library fails to load.
-
ParallelWaitError<
V, E> - Error thrown when waiting for multiple futures, when some have errors.
- TimeoutException
- Thrown when a scheduled timeout happens while waiting for an async result.