flutterbackground-serviceflutter-background

How to stop and re-schedule a background service?


So I am using the flutter_background_service package to run a background service for the application. Currently I am using a Timer.periodic method to constantly hit an API every 5 seconds. But now I want to reduce the battery usage in background. For that I want to make it so that, it only hits the API every 15 minutes and once it hits the API the service should stop and restart after 15 minutes. How can I do that? Can anyone help me?


Solution

  • I talked to the owner of the flutter_background_service package. There is no way to do this.