reverse method Null safety
Reverse Geosearch
Implementation
Future<GoogleGeocodingResponse> reverse(
String latlng, {
String? locationType,
String? resultType,
String? language,
}) async {
final Map<String, dynamic> query = <String, dynamic>{
'latlng': latlng,
'language': language,
'result_type': resultType,
'location_type': locationType,
};
query.removeWhere((_, dynamic value) => value == null);
final Response<Map<String, dynamic>> response =
await _dio.get<Map<String, dynamic>>(
_baseUrl,
queryParameters: query,
);
return GoogleGeocodingResponse.fromJson(response.data!);
}