Order.fromGraphJson constructor
The order from graph json
Implementation
factory Order.fromGraphJson(Map<String, dynamic> json) => Order(
id: json['node']['id'],
email: json['node']['email'] ?? '',
currencyCode: json['node']['currencyCode'],
customerUrl: json['node']['customerUrl'],
lineItems: LineItemsOrder.fromGraphJson(json['node']['lineItems']),
name: json['node']['name'] ?? '',
orderNumber: json['node']['orderNumber'] ?? 0,
phone: json['node']['phone'],
processedAt: json['node']['processedAt'],
financialStatus: json['node']['financialStatus'],
fulfillmentStatus: json['node']['fulfillmentStatus'],
shippingAddress: json['node']['shippingAddress'] == null
? null
: ShippingAddress.fromJson(json['node']['shippingAddress']),
billingAddress: json['node']['billingAddress'] == null
? null
: ShippingAddress.fromJson(json['node']['billingAddress']),
statusUrl: json['node']['statusUrl'],
subtotalPrice: PriceV2.fromJson(json['node']['subtotalPrice']),
totalPrice: PriceV2.fromJson(json['node']['totalPrice']),
totalRefunded: PriceV2.fromJson(json['node']['totalRefunded']),
totalShippingPrice:
PriceV2.fromJson(json['node']['totalShippingPrice']),
totalTax: PriceV2.fromJson(json['node']['totalTax']),
cursor: json['cursor'],
canceledAt: json['node']['canceledAt'],
cancelReason: json['node']['cancelReason'],
successfulFulfillments: _getSuccessfulFulfilments(
json['node']['successfulFulfillments'] ?? [],
),
);