cancelWithReason method

  1. @mustCallSuper
void cancelWithReason(
  1. String? cancellationReason
)

A convenience method for cancelling the token with a CancelledException that includes the reason for cancellation.

Implementation

@mustCallSuper
void cancelWithReason(String? cancellationReason) {
  cancel(CancelledException(cancellationReason: cancellationReason));
}