From 1141b6a35afb5f9fa50737f5ea3ba45f31e38f60 Mon Sep 17 00:00:00 2001 From: vladimir98vk Date: Thu, 25 May 2023 14:10:18 +0200 Subject: [PATCH] Display hours only if non 0 --- lib/utility/time_keeper.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/utility/time_keeper.dart b/lib/utility/time_keeper.dart index e5ad80e..8eb009f 100644 --- a/lib/utility/time_keeper.dart +++ b/lib/utility/time_keeper.dart @@ -27,6 +27,9 @@ class TimeKeeper with ChangeNotifier { final String hourLeft = h.toString().length < 2 ? "0$h" : h.toString(); final String minuteLeft = m.toString().length < 2 ? "0$m" : m.toString(); final String secondsLeft = s.toString().length < 2 ? "0$s" : s.toString(); + if (hourLeft == "00") { + return "$minuteLeft:$secondsLeft"; + } return "$hourLeft:$minuteLeft:$secondsLeft"; }