resolveAllThen<R> method
Same as Future.wait(this).then
.
- Note: it's not possible to implement
onError
and have the same behavior at Future.then, sinceonError
will be called only ifthis
is a Future, and not when it's aT
.
Implementation
FutureOr<R> resolveAllThen<R>(FutureOr<R> Function(List<T> values) onValues) {
var all = resolveAll();
if (all is List<T>) {
return onValues(all);
} else {
return all.then(onValues);
}
}