Address class
Labeled postal address.
While structured components are available for compatibility with Android and iOS, it is recommended to use only the formatted address. Even if the native contact only has structured components (e.g. street and city), the address is reconstructed from them, so it is guaranteed to always be present.
Field | Android | iOS |
---|---|---|
street | ✔ | ✔ |
pobox | ✔ | ⨯ |
neighborhood | ✔ | ⨯ |
city | ✔ | ✔ |
state | ✔ | ✔ |
postalCode | ✔ | ✔ |
country | ✔ | ✔ |
isoCountry | ⨯ | ✔ |
subAdminArea | ⨯ | ✔ |
subLocality | ⨯ | ✔ |
Constructors
- Address(String address, {AddressLabel label = AddressLabel.home, String customLabel = '', String street = '', String pobox = '', String neighborhood = '', String city = '', String state = '', String postalCode = '', String country = '', String isoCountry = '', String subAdminArea = '', String subLocality = ''})
-
Address.fromJson(Map<
String, dynamic> json) -
factory
Properties
- address ↔ String
-
Formatted address.
getter/setter pair
- city ↔ String
-
City.
getter/setter pair
- country ↔ String
-
Country.
getter/setter pair
- customLabel ↔ String
-
Custom label, if label is AddressLabel.custom.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setteroverride
- isoCountry ↔ String
-
ISO 3166-1 alpha-2 standard (iOS only).
getter/setter pair
- label ↔ AddressLabel
-
Label (default AddressLabel.home).
getter/setter pair
- neighborhood ↔ String
-
Neighborhood (Android only).
getter/setter pair
- pobox ↔ String
-
PO box (Android only).
getter/setter pair
- postalCode ↔ String
-
Postal code / zip code.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state ↔ String
-
US state, or region/department/county on Android.
getter/setter pair
- street ↔ String
-
Street name and house number.
getter/setter pair
- subAdminArea ↔ String
-
Region/county on iOS.
getter/setter pair
- subLocality ↔ String
-
Anything else describing the address (iOS only).
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
override
-
toVCard(
) → List< String>
Operators
-
operator ==(
Object o) → bool -
The equality operator.
override