stopSchedule static method
Halt scheduled tracking.
BackgroundGeolocation.stopSchedule.then((State state) {
print('[stopSchedule] success: ${state}');
})
WARNING: stopSchedule will not execute stop if the plugin is currently tracking. You must explicitly execute stop.
Example
// Later when you want to stop the Scheduler (eg: user logout)
await BackgroundGeolocation.stopSchedule().then((State state) {
if (state.enabled) {
BackgroundGeolocation.stop();
}
})
Implementation
static Future<State> stopSchedule() async {
Map state = (await _methodChannel.invokeMapMethod('stopSchedule'))!;
return State(state);
}