'How to fetch data from SendLocationEvent in background locator

I am building application which needs to track user trajectories to detect if user has a pattern .

I am using flutter and Carp background location which is built around another package that is called background locator .

background locator tracks user even when app is closed or terminated by making the service a foreground service . when the app is running I am able to fetch the data it sends and save it in sqf lite table , but when the app is terminated the carp foreground service keeps on running and printing SendLocationEvent to the terminal but I can't fetch the data . I tried using background fetch package but its not what I need. is there a way I can put the sqflite insertion code in the Carp foreground tracking service ?



Sources

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

Source: Stack Overflow

Solution Source