fetchGeocode method
Future<List<MFGeocodeResult> >
fetchGeocode({
- MFLocationComponent? location,
- String? address,
- MFViewboxComponent? viewbox,
Geocode
Implementation
Future<List<MFGeocodeResult>> fetchGeocode(
{MFLocationComponent? location,
String? address,
MFViewboxComponent? viewbox}) async {
final Map<String, Object> data = <String, Object>{};
if (location != null) {
data['location'] = location.toJson();
}
if (address != null) {
data['address'] = address;
}
if (viewbox != null) {
data['viewbox'] = viewbox.toJson();
}
final response =
await _ServicesChannel.invokeService('geocode#geocode', data);
validateResponse(response);
return toListGeocode(response!['result']);
}