destroyLocationUpdates method Null safety

Future<void> destroyLocationUpdates()

Destroy the location updates previously received

Implementation

Future<void> destroyLocationUpdates() async {
  await BackgroundGeolocation.destroyLocations();
  BackgroundGeolocation.removeListener(addLocation);
  locationCount = 0;
  locations.clear();
}