wait method

Future wait ()

Returns a future that will complete when the WaitGroup counter is zero.

Implementation

Future wait() {
  if (_counter == 0) {
    return new Future.value();
  }
  if (_completer == null) {
    _completer = new Completer();
  }
  return _completer.future;
}