cancel method

void cancel()

Implementation

void cancel() {
  if (running) {
    _running = false;
    _timer?.cancel();
    _timer = null;
  }
}