completeSafe method

bool completeSafe([
  1. FutureOr<T>? value
])

Calls complete only if ![isCompleted] and returns true, otherwise just returns false.

Implementation

bool completeSafe([FutureOr<T>? value]) {
  if (!isCompleted) {
    complete(value);
    return true;
  }
  return false;
}