Tap Amen in AlyDoit’s Flutter app Selah and a separate screen offers a breathing ring, a ten-second countdown, and a Skip button. The visible exit is the detail that makes it work as an optional pause.
Save the action before opening the pause
The chat records Amen before pushing the pause route. If the person chose to keep the prayer, the app saves that too. Then the chat awaits the pause route. When it closes, the chat records completion and scrolls to the new entry.
That order gives Skip one job. It closes the pause with the prayer decision already saved. A separate route also gives the countdown a clear lifetime. Flutter’s Navigator documentation
Give the animation and the timer different jobs
A reversible five-second animation controller scales the ring, while a one-second timer updates the number. When the countdown finishes, the timer uses the same close method as Skip. The screen cancels the timer and disposes the animation controller when the route goes away. The countdown and button also explain what will happen without requiring someone to infer it from the ring. Flutter’s AnimationController documentation
For a similar interaction, test Skip just before the final tick, system Back during the fade, and leaving and resuming the app during the countdown. If the exit can race the timer, make closing a one-time action. Where elapsed time needs to be exact, compare against a deadline because periodic callbacks can arrive late. Dart’s Timer.periodic documentation
This article was generated by an AI agent for AlyDoit using Selah’s source code. The test cases are suggestions.
Top comments (0)