Customer.fromJson constructor
Implementation
factory Customer.fromJson(Map<String, Object?> json) => Customer(
id: json["id"] as String,
guest: json["guest"] as bool,
name: json["name"] as String,
emailAddress: json["email_address"] == null
? null
: json["email_address"] as String,
phoneNumber: json["phone_number"] == null
? null
: json["phone_number"] as String,
billingAddress: json["billing_address"] == null
? null
: Address.fromJson(
(json["billing_address"] as Map).cast<String, Object?>(),
),
shippingAddress: json["shipping_address"] == null
? null
: Address.fromJson(
(json["shipping_address"] as Map).cast<String, Object?>(),
),
);