cancel method

void cancel()

Cancels the timer.

Implementation

void cancel() {
  isRunning = false;
  timer?.cancel();
}