placeGeocoding method

Future<GoogleGeocodingResponse> placeGeocoding(
  1. String placeId, {
  2. String? language,
  3. String? resultType,
  4. String? region,
  5. String? locationType,
})

Implementation

Future<GoogleGeocodingResponse> placeGeocoding(
  String placeId, {
  String? language,
  String? resultType,
  String? region,
  String? locationType,
}) async {
  final Map<String, dynamic> query = <String, dynamic>{
    'place_id': placeId,
    if (language != null) 'language': language,
    if (resultType != null) 'result_type': resultType,
    if (locationType != null) 'location_type': locationType,
    if (region != null) 'region': region,
  };

  final Response<Map<String, dynamic>> response =
      await _dio.get<Map<String, dynamic>>(
    _baseUrl,
    queryParameters: query,
  );
  return _mapOrThrow(response.data!);
}