I am following this plugin (learning) background locator . I have previously used other background location plugins but they are not maintained anymore.
I am following the tutorial as described in the description of the plugin and so far this is my code. I am unsure about what exactly a callback is and how do I use it.
This is my code so far but I don't get any results.
static void backgroundLocationCallBack(LocationDto location) async {
await BackgroundLocator.initialize();
await BackgroundLocator.isServiceRunning();
}
void getLocationLiveUpdates() async {
return await BackgroundLocator.registerLocationUpdate(
backgroundLocationCallBack,
autoStop: false,
// disposeCallback: backgroundLocationDisposeCallBack,
androidSettings: AndroidSettings(
accuracy: LocationAccuracy.NAVIGATION,
interval: 5,
distanceFilter: 0,
client: LocationClient.google,
androidNotificationSettings: AndroidNotificationSettings(
notificationChannelName: 'Location tracking',
notificationTitle: 'Start Location Tracking',
notificationMsg: 'Track location in background',
notificationBigMsg:
'Background location is on to keep the app up-tp-date with your location. This is required for main features to work properly when the app is not running.',
notificationIconColor: Colors.grey,
)));
}