restart method
This Method Restarts the Countdown Timer, Here optional int parameter duration is the updated duration for countdown timer
Implementation
void restart({int? duration}) {
_state._controller!.duration =
Duration(seconds: duration ?? _state._controller!.duration!.inSeconds);
if (_isReverse) {
_state._controller?.reverse(from: 1);
} else {
_state._controller?.forward(from: 0);
}
isStarted = true;
isPaused = false;
isResumed = false;
}