'FLUTTER ANDROID ONLY: sent location data to REST API continuously even when my app is minimized/closed

I want to continuously send location data to REST API (PATCH METHODS) even when my app is minimized/closed. I put my function on InitState, but when I minimized the app.. the function is gone,

How can I avoid this so I can Patch my data continually?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source