cancel method

  1. @override
void cancel([
  1. bool autoDispose = true
])

Cancels this token and notifies onCancel listener. Typically called by Client.

Implementation

@override
void cancel([bool autoDispose = true]) {
  super.cancel();

  _isActive = false;
  onCancel?.call();

  if (autoDispose) {
    dispose();
  }
}