getNearbyEntities method

Future<List<Locality>> getNearbyEntities(
  1. double latitude,
  2. double longitude,
  3. double range
)

Get all nearby entities in the range around the point that consists of latitude and longitude on a world map.

Implementation

Future<List<Locality>> getNearbyEntities(double latitude, double longitude, double range) async {
  Completer<List<Locality>> completer = Completer();
  if ( phoenixChannel != null ) {
    phoenixChannel!.push('get_neighbors_within_radius', {
      'lat': latitude,
      'long': longitude,
      'radius': range
    }).onReply("ok", (response) {
      print("REPLY OK NEARBY ENTITIES ${response.response}");
      completer.complete([]);
    });
  }
  return completer.future;
}