getPlaceDetail static method
Implementation
static Future<Place?> getPlaceDetail(String placeId, String mapsKey,
{String? otherOptions}) async {
/// referenceUrl = https://developers.google.com/maps/documentation/places/web-service/place-id
// https://maps.googleapis.com/maps/api/place/details/json?place_id=ChIJrTLr-GyuEmsRBfy61i59si0&key=YOUR_API_KEY
String mapOptions =
['place_id=$placeId', 'key=$mapsKey', otherOptions].join('&');
http.Response response = await http.get(Uri.parse(
"https://maps.googleapis.com/maps/api/place/details/json?$mapOptions"));
debugPrint(response.body.toString());
if (response.statusCode == 200) {
return placeFromJson(response.body);
} else {
debugPrint(response.statusCode.toString());
}
return null;
}