From b008ef7c833505e693f94fbcbbfb61b80fdf2c4a Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Tue, 30 Apr 2024 22:01:19 +0200 Subject: [PATCH] fixed timer stop state --- lib/screens/timer/bloc_timer.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/screens/timer/bloc_timer.dart b/lib/screens/timer/bloc_timer.dart index 4c00a25..91d974a 100644 --- a/lib/screens/timer/bloc_timer.dart +++ b/lib/screens/timer/bloc_timer.dart @@ -38,9 +38,10 @@ class TimerBloc extends Bloc { ); _timer = Timer.periodic(const Duration(seconds: 1), (_) { - add(SetTimeLeftEvent(state.timeLeft - const Duration(seconds: 1))); if (state.timeLeft.inMilliseconds == 0) { add(const StopTimerEvent()); + } else { + add(SetTimeLeftEvent(state.timeLeft - const Duration(seconds: 1))); } }); }