Make sure to import dart:async package to start of program to use Timer .
Read moreHow do you run a Timer on flutter?
We will also create a timer variable and create a bool variable countDown is equal to true.
Read moreHow do I run code in the background even with the screen off Flutter?
For the above log output, here are the steps I did:
Read moreWhat is background service in Flutter?
Running background task is one of the most important tasks that we can perform in an Android or iOS app. we can run background task as background service or foreground service. Flutter, being a very Versatile solution for programming, allows us to write platform-specific code to achieve your background tasks !22 Tem 2021
Read moreHow do you hit API in background Flutter?
Run your code in background easily with Flutter
Read more