stop method Null safety

void stop()

Implementation

void stop() {
  timer?.cancel();
}