stop method

void stop()

Stops (or pauses) the time countdown.

If the CountdownTimer currently stopped, then calling stop does nothing.

Implementation

void stop() {
  if (!_watch.isRunning || _callback == null) {
    return;
  }

  _watch.stop();
  final remaining = _duration.inMicroseconds - _watch.elapsedMicroseconds;
  if (remaining <= 0) {
    _handle();
    return;
  }

  _timer.cancel();
}