stop method

void stop()

Stops the timer.

Throws an assertion error if endTime is not null.

Implementation

void stop() {
  assert(endTime == null, 'endTime must be null to stop');
  if (_timer != null && _timer!.isActive) {
    _timer?.cancel();
  }
  _duration = Duration.zero;
  _pause = Duration.zero;
  notifyListeners();
}