attachCancellable method

  1. @override
void attachCancellable(
  1. Cancellable cancellable
)
override

Attaches a Cancellable to this token.

Before attaching to a CancellationToken, you should check if it's already been cancelled by using isCancelled.

Implementation

@override
void attachCancellable(Cancellable cancellable) {
  if (!isCancelled && _timer == null) Timer(_duration, _onTimerEnd);
  super.attachCancellable(cancellable);
}