getLocationUpdates static method
Register a function to receive location updates as long as the location service has started
Implementation
static StreamController<Location>? getLocationUpdates(void Function(Location) location) {
if (locationCallbackStream?.isClosed == false) {
locationCallbackStream?.close();
}
locationCallbackStream = StreamController();
locationCallbackStream?.stream.listen(location);
return locationCallbackStream;
}