onLocationChange method

  1. @override
StreamSubscription onLocationChange(
  1. LocationChangeListener callback
)
override

Implementation

@override
StreamSubscription<dynamic> onLocationChange(
    LocationChangeListener callback) {
  return eventChannel.receiveBroadcastStream().listen((event) {
    Map<String, dynamic> data =
        (event as Map<Object?, Object?>).cast<String, dynamic>();
    Location location = Location.fromJson(data);
    callback(location);
  });
}