getSimpleAddress method

SimpleAddress getSimpleAddress()

Implementation

SimpleAddress getSimpleAddress() {
  final address = SimpleAddress(
    streetNumber: _getAddressComponent('street_number')?.longName,
    route: _getAddressComponent('route')?.longName,
    subLocality: _getAddressComponent('sublocality')?.longName,
    locality: _getAddressComponent('locality')?.longName,
    administrativeAreaLevel3:
        _getAddressComponent('administrative_area_level_3')?.longName,
    administrativeAreaLevel2:
        _getAddressComponent('administrative_area_level_2')?.longName,
    administrativeAreaLevel1:
        _getAddressComponent('administrative_area_level_1')?.longName,
    country: _getAddressComponent('country')?.longName,
    postalCode: _getAddressComponent('postal_code')?.longName,
    location: geometry.location,
    formattedAddress: formattedAddress,
  );
  return address;
}