isCancelledSync method

bool isCancelledSync({
  1. bool throwIfCancelled = false,
})

Synchronously check whether the token has been cancelled.

Implementation

bool isCancelledSync({bool throwIfCancelled = false}) {
  final ex = exception;
  return (ex == null)
      ? false
      : throwIfCancelled
          ? throw ex
          : true;
}