startCountdown method
Starts the countdown of timer
Implementation
void startCountdown(Duration duration) async {
_counter = duration.inSeconds;
// Cancel old active timer
if (_timer != null && _timer!.isActive) {
_timer!.cancel();
}
_isRunning = true;
_isTimesUp = false;
_timer = startTimer();
notifyListeners();
}