clearTimer method

void clearTimer()

Implementation

void clearTimer() {
  if (timer != null) {
    timer?.cancel();
    timer = null;
  }
}