cancel method

void cancel()

Drop this decision without delivering the action (e.g. the host UI was dismissed or the agent loop was torn down). Completes the future with null; the whenComplete callback then removes it from pending.

Implementation

void cancel() {
  if (!_completer.isCompleted) _completer.complete(null);
}