clearCompleters method Null safety

void clearCompleters(
  1. {Error? error}
)

Implementation

void clearCompleters({Error? error}) {
  _completers.forEach((key, value) {
    if (error != null) {
      value.completeError(error);
    } else {
      value.complete();
    }
  });
  _completers.removeWhere((key, value) => true);
}