stop method

void stop()

Stops (or pauses) the time countdown.

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

Implementation

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

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

  _timer.cancel();
}