waitForComplete method

Future<void> waitForComplete()

Waits until the process is completed.

Implementation

Future<void> waitForComplete() async {
  if (complete) {
    if (error != null) {
      if (error?.stackTrace != null) {
        throw Error.throwWithStackTrace(error!.error, error!.stackTrace!);
      }
      throw error!.error;
    }
    return;
  }
  if (_startupCompleter == null || _startupCompleter?.isCompleted == true) {
    _startupCompleter = Completer<void>();
  }
  return await _startupCompleter!.future;
}