Add getter for remaining time

This commit is contained in:
Kelrap 2024-08-12 16:04:11 -04:00
parent e7f3b9e73a
commit 1a841d382f

View file

@ -27,8 +27,10 @@ class RoundTimerState extends State<RoundTimer> {
});
}
int get remainingTime => widget.timerMaxSeconds - currentSeconds;
String get timerText =>
'${((widget.timerMaxSeconds - currentSeconds) ~/ 60).toString().padLeft(2, '0')}: ${((widget.timerMaxSeconds - currentSeconds) % 60).toString().padLeft(2, '0')}';
'${(remainingTime ~/ 60).toString().padLeft(2, '0')}: ${(remainingTime % 60).toString().padLeft(2, '0')}';
startTimeout([int milliseconds = 1000]) {
_timer = Timer.periodic(const Duration(seconds: 1), (timer) {