From fbd78986df51cedd52186337d26d23d8eb72851a Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Sat, 4 May 2024 18:59:12 +0200 Subject: [PATCH] automatically close timer screen after timeout --- lib/screens/timer/screen_timer.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/screens/timer/screen_timer.dart b/lib/screens/timer/screen_timer.dart index ab72679..285d8f4 100644 --- a/lib/screens/timer/screen_timer.dart +++ b/lib/screens/timer/screen_timer.dart @@ -44,7 +44,9 @@ class TimerScreenState extends State with TickerProviderStateMixin timelineController = AnimationController(vsync: this, duration: widget.duration); timelineAnimation = Tween(begin: 1, end: 0).animate(timelineController); timelineController.addStatusListener((status) { - if (status == AnimationStatus.completed) { + if (timelineController.value == 1) { + Navigator.of(context).pop(); + } else if (status == AnimationStatus.completed) { context.read().add(const TimerEndedEvent()); } });