cancel method

void cancel()

Implementation

void cancel() {
  if (_state.cancelled) return;
  _state.cancelled = true;
  final completer = _state.currentCompleter;
  _state.currentCompleter = null;
  _state.currentWidget = null;
  if (completer != null && !completer.isCompleted) {
    completer.completeError(const ChainCancelled());
  }
  _onRequestRedraw();
}