1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-26 04:48:51 +00:00

Fix little issues with countdown timer.

This commit is contained in:
Pierre HUBERT 2019-11-02 20:17:00 +01:00
parent bcf9a1586a
commit 527927da82

View File

@ -30,7 +30,7 @@ class _CountdownWidgetState extends State<CountdownWidget> {
int get totalDuration => (widget.endTime - widget.startTime).abs();
String get remainingTimeStr {
final remaining = Duration(seconds: remainingTime);
final remaining = Duration(seconds: remainingTime.abs());
return tr(
"%days% Days %hours% Hours %minutes% Minutes %seconds% Seconds",
@ -51,7 +51,10 @@ class _CountdownWidgetState extends State<CountdownWidget> {
}
void _timerCb(Timer timer) {
if (!mounted) timer.cancel();
if (!mounted) {
timer.cancel();
return;
}
setState(() {});
}