mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
Fix little issues with countdown timer.
This commit is contained in:
parent
bcf9a1586a
commit
527927da82
@ -30,7 +30,7 @@ class _CountdownWidgetState extends State<CountdownWidget> {
|
|||||||
int get totalDuration => (widget.endTime - widget.startTime).abs();
|
int get totalDuration => (widget.endTime - widget.startTime).abs();
|
||||||
|
|
||||||
String get remainingTimeStr {
|
String get remainingTimeStr {
|
||||||
final remaining = Duration(seconds: remainingTime);
|
final remaining = Duration(seconds: remainingTime.abs());
|
||||||
|
|
||||||
return tr(
|
return tr(
|
||||||
"%days% Days %hours% Hours %minutes% Minutes %seconds% Seconds",
|
"%days% Days %hours% Hours %minutes% Minutes %seconds% Seconds",
|
||||||
@ -51,7 +51,10 @@ class _CountdownWidgetState extends State<CountdownWidget> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _timerCb(Timer timer) {
|
void _timerCb(Timer timer) {
|
||||||
if (!mounted) timer.cancel();
|
if (!mounted) {
|
||||||
|
timer.cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user