onLocationChanged property
Returns a stream of LocationData
objects. The frequency and accuracy of
this stream can be changed with changeSettings.
Throws an error if the app has no permission to access location.
Implementation
@override
Stream<LocationData> get onLocationChanged {
return _onLocationChanged ??= _eventChannel!
.receiveBroadcastStream()
.map<LocationData>((dynamic event) {
event as Map<Object?, Object?>;
return LocationData.fromMap(
Map<String, dynamic>.of(event.cast<String, dynamic>()),
);
});
}