PEGooglePayAddress class

A model representing a Google Pay address.

This class holds address details provided by Google Pay, including street addresses, locality, postal code, and contact information.

Example Usage:

// Creating an address instance manually
final address = PEGooglePayAddress(
  address1: "1600 Amphitheatre Parkway",
  administrativeArea: "CA",
  countryCode: "US",
  locality: "Mountain View",
  name: "John Doe",
  phoneNumber: "+1 123-456-7890",
  postalCode: "94043",
);

// Creating an address instance from JSON
final json = {
  "address1": "1600 Amphitheatre Parkway",
  "administrativeArea": "CA",
  "countryCode": "US",
  "locality": "Mountain View",
  "name": "John Doe",
  "phoneNumber": "+1 123-456-7890",
  "postalCode": "94043"
};
final googlePayAddress = PEGooglePayAddress.fromJson(json);

// Converting an address instance to JSON
final jsonOutput = googlePayAddress.toJson();
print(jsonOutput);

Constructors

PEGooglePayAddress({String? address1, String? address2, String? address3, String? administrativeArea, String? countryCode, String? locality, String? name, String? phoneNumber, String? postalCode})
Creates an instance of PEGooglePayAddress.
const
PEGooglePayAddress.fromJson(Map<String, dynamic> json)
Creates a PEGooglePayAddress instance from a JSON map.
factory

Properties

address1 String?
The first line of the address (e.g., street name and number).
final
address2 String?
The second line of the address (e.g., apartment, suite, or unit number).
final
address3 String?
The third line of the address (if applicable).
final
administrativeArea String?
The administrative area (e.g., state, province, or region).
final
countryCode String?
The two-letter country code (ISO 3166-1 alpha-2 format, e.g., "US").
final
hashCode int
The hash code for this object.
no setterinherited
locality String?
The city or locality of the address.
final
name String?
The name of the recipient or person associated with the address.
final
phoneNumber String?
The phone number associated with the address.
final
postalCode String?
The postal code or ZIP code of the address.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this PEGooglePayAddress instance to a JSON map.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited