isCompleted property

bool get isCompleted

Indicates whether the completer has been claimed for completion.

Returns true once any of the following holds:

  1. A resolve has been accepted (even if its underlying future has not yet settled — the completer is "committed" and subsequent resolves will be rejected with an Err).
  2. The wrapped Completer has been completed synchronously.
  3. The cached value has been populated.

Reading this property does not race with an in-flight async resolve: observers see true for the entire interval starting when resolve accepts work, not only after the underlying future settles.

Implementation

@pragma('vm:prefer-inline')
bool get isCompleted =>
    _isCompleting || _completer.isCompleted || _value.isSome();