start method

void start({
  1. required String title,
  2. required Duration duration,
})

Starts a new timer with the given title and duration. Cancels any previous timer.

Implementation

void start({required String title, required Duration duration}) {
  cancel();
  isPaused = false;
  this.title = title;
  timeLeft = duration;
  _timer = Timer.periodic(const Duration(seconds: 1), _update);
  notifyListeners();
}