FutureGroup<T> class

A collection of futures waits until all added Futures complete.

Futures are added to the group with add. Once you're finished adding futures, signal that by calling close. Then, once all added futures have completed, future will complete with a list of values from the futures in the group, in the order they were added.

If any added future completes with an error, future will emit that error and the group will be closed, regardless of the state of other futures in the group.

This is similar to Future.wait with eagerError set to true, except that a FutureGroup can have futures added gradually over time rather than needing them all at once.

Implemented types




future Future<List<T>>
The future that fires once close has been called and all futures in the group have completed.
no setter
hashCode int
The hash code for this object.
no setterinherited
isClosed bool
Whether the group is closed, meaning that no more futures may be added.
no setter
isIdle bool
Whether this group contains no futures.
no setter
onIdle Stream
A broadcast stream that emits an event whenever this group becomes idle.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited


add(Future<T> task) → void
Wait for task to complete.
close() → void
Signals to the group that the caller is done adding futures, and so future should fire once all added futures have completed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.