Add getter for remaining time
This commit is contained in:
parent
e7f3b9e73a
commit
1a841d382f
1 changed files with 3 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue