Orders.fromJson constructor

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

Implementation

factory Orders.fromJson(Map<String, dynamic> json) => Orders(
      id: json["id"],
      parentId: json["parent_id"],
      number: json["number"],
      orderKey: json["order_key"],
      createdVia: json["created_via"],
      version: json["version"],
      status: json["status"],
      currency: json["currency"],
      dateCreated: DateTime.parse(json["date_created"]),
      dateCreatedGmt: DateTime.parse(json["date_created_gmt"]),
      dateModified: DateTime.parse(json["date_modified"]),
      dateModifiedGmt: DateTime.parse(json["date_modified_gmt"]),
      discountTotal: json["discount_total"],
      discountTax: json["discount_tax"],
      shippingTotal: json["shipping_total"],
      shippingTax: json["shipping_tax"],
      cartTax: json["cart_tax"],
      total: json["total"],
      totalTax: json["total_tax"],
      pricesIncludeTax: json["prices_include_tax"],
      customerId: json["customer_id"],
      customerIpAddress: json["customer_ip_address"],
      customerUserAgent: json["customer_user_agent"],
      customerNote: json["customer_note"],
      billing: Ing.fromJson(json["billing"]),
      shipping: Ing.fromJson(json["shipping"]),
      paymentMethod: json["payment_method"],
      paymentMethodTitle: json["payment_method_title"],
      transactionId: json["transaction_id"],
      datePaid: json["date_paid"] == null
          ? null
          : DateTime.parse(json["date_paid"]),
      datePaidGmt: json["date_paid_gmt"] == null
          ? null
          : DateTime.parse(json["date_paid_gmt"]),
      dateCompleted: json["date_completed"] == null
          ? null
          : DateTime.parse(json["date_completed"]),
      dateCompletedGmt: json["date_completed_gmt"] == null
          ? null
          : DateTime.parse(json["date_completed_gmt"]),
      cartHash: json["cart_hash"],
      metaData: List<MetaDatum>.from(
          json["meta_data"].map((x) => MetaDatum.fromJson(x))),
      lineItems: List<LineItem>.from(
          json["line_items"].map((x) => LineItem.fromJson(x))),
      taxLines: List<TaxLine>.from(
          json["tax_lines"].map((x) => TaxLine.fromJson(x))),
      shippingLines: List<ShippingLine>.from(
          json["shipping_lines"].map((x) => ShippingLine.fromJson(x))),
      feeLines: List<dynamic>.from(json["fee_lines"].map((x) => x)),
      couponLines: List<dynamic>.from(json["coupon_lines"].map((x) => x)),
      refunds: List<dynamic>.from(json["refunds"].map((x) => x)),
      links: CreateLinks.fromJson(json["_links"]),
    );