callNearby method

Future<NearbyResponse?> callNearby()

Implementation

Future<NearbyResponse?> callNearby() async {
  try {
    String? result = await restApi.nearby(toJson());
    return result != null
        ? NearbyResponse.fromMap(json.decode(result))
        : null;
  } on PlatformException catch (e) {
    return Future.error(e);
  }
}