IterableFutureOrExtension<T> extension

Extension for Iterable<FutureOr<T>>.

on

Properties

allAsList List<FutureOr<T>>
Returns all elements in a List. Ensures that an Iterable is fully constructed.
no setter
asFutures List<Future<T>>
Returns all FutureOr elements as Future.
no setter
isAllFuture bool
Returns true if all elements are a Future.
no setter
isAllResolved bool
Returns true if all elements are resolved, NOT a Future.
no setter

Methods

resolveAll() FutureOr<List<T>>
Resolve all elements.
resolveAllJoined<R>(FutureOr<R> joiner(List<T> r)) FutureOr<R>
Resolves all elements and join them with joiner.
resolveAllMapped<R>(R mapper(T e)) FutureOr<List<R>>
Resolves all elements and map them with mapper.
resolveAllReduced<R>(T reducer(T value, T element)) FutureOr<T>
Resolves all elements and reduce them with reducer.
resolveAllThen<R>(FutureOr<R> onValues(List<T> values)) FutureOr<R>
Same as Future.wait(this).then.
resolveAllValidated(bool validate(T e), {T? defaultValue}) FutureOr<List<T>>
Resolves all elements and validate them. If an element is not valid will use defaultValue.
resolveAllWith<R>(FutureOr<R> resolver()) FutureOr<R>
Resolves all elements then resolves with resolver result.
resolveAllWithValue<V>(V value) FutureOr<V>
Resolves all elements then resolves with value.
selectFutures() List<Future<T>>
Selects all elements that are a Future and returns a List of them.
selectResolved() List<T>
Selects all elements that are resolved (of type T)
waitFutures() FutureOr<List<T>>
Wait all elements that are Future.
waitFuturesAndReturnValue<V>(V value) FutureOr<V>
Waits futures and returns value.
whereFuture() Iterable<Future<T>>
Filters to Future elements.
whereResolved() Iterable<T>
Filters to resolved elements (of type T).