OrderData.fromJson constructor

OrderData.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory OrderData.fromJson(Map<String, dynamic> json) => OrderData(
    id: json["id"] == null ? null : json["id"],
    uuid: json["uuid"] == null ? null : json["uuid"],
    amount: json["amount"] == null ? null : json["amount"],
    currency: json["currency"] == null ? null : json["currency"],
    transactionId: json["transaction_id"] == null ? null : json["transaction_id"],
    customerId: json["customer_id"] == null ? null : json["customer_id"],
    merchantId: json["merchant_id"] == null ? null : json["merchant_id"],
    shippingFee: json["shipping_fee"] == null ? null : json["shipping_fee"],
    dateFulfilled: json["date_fulfilled"],
    country: json["country"] == null ? null : json["country"],
    state: json["state"] == null ? null : json["state"],
    city: json["city"] == null ? null : json["city"],
    streetAddress: json["street_address"] == null ? null : json["street_address"],
    zip: json["zip"] == null ? null : json["zip"],
    meta: json["meta"] == null ? null : json["meta"],
    status: json["status"] == null ? null : json["status"],
    deletedAt: json["deleted_at"],
    createdAt: json["created_at"] == null ? null : DateTime.parse(json["created_at"]),
    updatedAt: json["updated_at"] == null ? null : DateTime.parse(json["updated_at"]),
    products: json["products"] == null ? null : List<ProductData>.from(json["products"].map((x) => ProductData.fromJson(x))),
    customer: json["customer"] == null ? null : CustomerData.fromJson(json["customer"]),
);