cancelAll method
void
cancelAll()
Cancel all futures waiting for this Event to be set (those that are waiting for wait to return). This function throws an EventCancelledException to all these futures.
Implementation
void cancelAll() {
for (var waiter in _waiters) {
waiter.completeError(EventCancelledException());
}
_waiters.clear();
}