Address class Null safety
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.
read / write
- city ↔ String
-
City.
read / write
- country ↔ String
-
Country.
read / write
- customLabel ↔ String
-
Custom label, if label is AddressLabel.custom.
read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, override
- isoCountry ↔ String
-
ISO 3166-1 alpha-2 standard (iOS only).
read / write
- label ↔ AddressLabel
-
Label (default AddressLabel.home).
read / write
- neighborhood ↔ String
-
Neighborhood (Android only).
read / write
- pobox ↔ String
-
PO box (Android only).
read / write
- postalCode ↔ String
-
Postal code / zip code.
read / write
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- state ↔ String
-
US state, or region/department/county on Android.
read / write
- street ↔ String
-
Street name and house number.
read / write
- subAdminArea ↔ String
-
Region/county on iOS.
read / write
- subLocality ↔ String
-
Anything else describing the address (iOS only).
read / write
Methods
Operators
-
operator ==(
Object o) → bool -
The equality operator. [...]
override