FutureOrController<T> class

A controller for managing FutureOr operations and capturing exceptions.

Constructors

FutureOrController([_CallbackList<T> callbacks = const []])
Factory constructor to create a FutureOrController with optional callbacks.
factory

Properties

exceptions List<Object>
Returns a copy of the list of tracked exceptions.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(TSyncOrAsyncMapper<dynamic, T> callback) → void
Adds a single callback to the controller.
addAll(_CallbackList<T> callbacks) → void
Adds multiple callbacks to the controller.
addException(Object e) → void
Adds an exception to the list of tracked exceptions.
complete() FutureOr<void>
Evaluates all registered callbacks.
completeWith<R>(FutureOr<R> consolodator(FutureOr<List<T>> values)) FutureOr<R>
Evaluates all registered callbacks and returns the results, as determined by the consolodator function.
completeWithAll() FutureOr<List<T>>
Evaluates all registered callbacks and returns all the results.
completeWithFirst() FutureOr<T>
Evaluates all registered callbacks and returns the first result.
completeWithLast() FutureOr<T>
Evaluates all registered callbacks and returns the last result.
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

wait<T>(Iterable<FutureOr<T>> values, {bool eagerError = false, void cleanUp(T)?}) FutureOr<List<T>>
Waits for multiple values to complete, collects their results, and returns them in the same order.