How do I run a timer in the background

I have an app that has timers and I want it to be possible to exit the app and continue running the timer (with a notification possibly)

I want to use Timer.periodic, but after reading some articles and Stackoverflow answers it seems it’s not straightforward to run a process in the background.
I want to support both iOS and Android.

If I properly understood your question, you want your app to run the timer in the background (you can do that with the flutter_background_service package on both IOS and Android), and you can create notifications with the awesome_notifications package.