Open rajatjain7869 opened 4 years ago
@rajatjain7869 if you want to stop location updates, you have to capture the stream subscription from the location.onLocationChanged().listen, as such:
locationData = location.onLocationChanged().listen((LocationData cLoc) { currentLocation = cLoc; updatePinOnMap(); });
then anywhere you want to stop it, then you say:
locationData.cancel() or locationData.pause();
if you want to pick it back up, then you say:
locationData.resume();
Hope that helps!
@rajatjain7869 if you want to stop location updates, you have to capture the stream subscription from the location.onLocationChanged().listen, as such:
locationData = location.onLocationChanged().listen((LocationData cLoc) { currentLocation = cLoc; updatePinOnMap(); });
then anywhere you want to stop it, then you say:
locationData.cancel() or locationData.pause();
if you want to pick it back up, then you say:
locationData.resume();
Hope that helps!
aftter add .cancel(); or .pause(); , function showPinsOnMap(); not load (sourcePinInfo, destinationPinInfo).
this is Good example for live tracking but how we will stop the location updates or you can say location listener updates