Skip to content
Articles
Article

Keeping a Flutter timer honest when the app goes to the background

by Yacine Zitani dev.to

3 min read

A timer app has one job: be right. In Flutter the easy version is wrong the moment the user locks the phone. I build Flip Timer, a Pomodoro timer with a flip-clock display. This is how I made it keep correct time when the OS suspends the app. The snippets are trimmed from the real code. The problem The obvious design is a Timer.periodic that ticks once a second and adds a second to elapsed. It wo…

Forum

Questions about this, or something to add?

Discuss on the forum

Report this · Wrote this? Claim it

FlutterX is supported by