import 'dart:async';
StreamSubscription<LocationData> locationSubscription;
locationSubscription = location.onLocationChanged().listen((LocationData currentLocation)
{
//Your code
});
// Then, somewhere in your code
locationSubscription.cancel();