getFromLocationName method

Future<void> getFromLocationName(
  1. String locationName,
  2. int maxResults,
  3. GeocodeListener listener,
  4. GeographicBounds? bounds,
)

Returns an array of Addresses that attempt to describe the named location, which may be a place name such as "Dalvik, Iceland", an address such as "1600 Amphitheatre Parkway, Mountain View, CA", an airport code such as "SFO", and so forth.

Additional bounds can be specified to describe a geographical box to which the search area will be limited.

Implementation

Future<void> getFromLocationName(
  String locationName,
  int maxResults,
  GeocodeListener listener,
  GeographicBounds? bounds,
) async {
  final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec =
      _pigeonVar_codecGeocoder;
  final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger;
  const String pigeonVar_channelName =
      'dev.flutter.pigeon.geocoding_android.Geocoder.getFromLocationName';
  final BasicMessageChannel<Object?> pigeonVar_channel =
      BasicMessageChannel<Object?>(
    pigeonVar_channelName,
    pigeonChannelCodec,
    binaryMessenger: pigeonVar_binaryMessenger,
  );
  final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel
      .send(<Object?>[this, locationName, maxResults, listener, bounds]);
  final List<Object?>? pigeonVar_replyList =
      await pigeonVar_sendFuture as List<Object?>?;
  if (pigeonVar_replyList == null) {
    throw _createConnectionError(pigeonVar_channelName);
  } else if (pigeonVar_replyList.length > 1) {
    throw PlatformException(
      code: pigeonVar_replyList[0]! as String,
      message: pigeonVar_replyList[1] as String?,
      details: pigeonVar_replyList[2],
    );
  } else {
    return;
  }
}