lookupPlaceInGoogle function

Future<PlaceDetails?> lookupPlaceInGoogle(
  1. String? placeId
)

Implementation

Future<gmaps.PlaceDetails?> lookupPlaceInGoogle(String? placeId) async {
  if (placeId == null) {
    return null;
  }
  final placesApi =
      gmaps.GoogleMapsPlaces(apiKey: ThirdPartyCreds.googlePlaces.credentials);
  var gmapsUrl = placesApi.buildDetailsUrl(placeId: placeId);
  var url = rproxy.gmaps(gmapsUrl);
  var resp = await http.get(Uri.parse(url));
  return gmaps.PlacesDetailsResponse.fromJson(
          json.decode(resp.body) as Map<String, dynamic>)
      .result;
}