restart method

void restart()

Restarts the timer.

Throws an assertion error if endTime is not null.

Implementation

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