Address class
Represents a physical address.
This entity can be used for shipping addresses, billing addresses, customer addresses, and store locations. Supports both structured address formats and free-form address lines.
- Annotations
Constructors
-
Address({String? id, String? type, String? firstName, String? lastName, String? company, String? address1, String? address2, String? city, String? state, String? stateCode, String? postalCode, Country? country, String? phone, String? email, double? latitude, double? longitude, bool isDefault = false, bool isVerified = false, String? instructions, String? formattedAddress, Map<
String, dynamic> ? extensions}) -
const
-
Address.fromJson(Map<
String, dynamic> json) -
factory
Properties
- address1 → String?
-
Address line 1 (street address, P.O. Box, etc.)
final
- address2 → String?
-
Address line 2 (apartment, suite, unit, building, floor, etc.)
final
- city → String?
-
City or locality
final
- company → String?
-
Company name (optional)
final
- country → Country?
-
Country information
final
- email → String?
-
Email address
final
-
extensions
→ Map<
String, dynamic> ? -
finalinherited
- firstName → String?
-
First name of the recipient/person
final
- formattedAddress → String?
-
Formatted address as a single string (for display purposes)
final
- fullName → String
-
Returns the full name (firstName + lastName)
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
Unique identifier for the address
final
- instructions → String?
-
Any special delivery instructions
final
- isDefault → bool
-
Whether this is the default address
final
- isVerified → bool
-
Whether this address has been verified
final
- lastName → String?
-
Last name of the recipient/person
final
- latitude → double?
-
Geographic latitude coordinate
final
- longitude → double?
-
Geographic longitude coordinate
final
-
multiLineAddress
→ List<
String> -
Returns a multi-line formatted address
no setter
- phone → String?
-
Phone number
final
- postalCode → String?
-
Postal code or ZIP code
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- singleLineAddress → String
-
Returns a formatted single-line address string
no setter
- state → String?
-
State, province, or region
final
- stateCode → String?
-
State/province code (e.g., 'CA' for California)
final
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited - type → String?
-
Address type (e.g., 'shipping', 'billing', 'home', 'work', 'store')
final
Methods
-
copyWith(
{String? id, String? type, String? firstName, String? lastName, String? company, String? address1, String? address2, String? city, String? state, String? stateCode, String? postalCode, Country? country, String? phone, String? email, double? latitude, double? longitude, bool? isDefault, bool? isVerified, String? instructions, String? formattedAddress, Map< String, dynamic> ? extensions}) → Address -
getExtension<
T> (String key) → T? -
inherited
-
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.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited