I was able to successfully implement a countup timer using Timer.periodic()
.
If I switch between apps or take the app in the background for 30 seconds, current duration of the timer is still accurate.
However, if app is in the background for more than 2 minutes, current duration is not accurate and is actually delayed. Like the timer of the app slows down when it's in the background for too long.
Is using a background service a solution to this?
or should I just store the value of the duration when the app gets in the background and fetch it when it resumes?
Would like to get some suggestions. Thanks!