Order constructor
const
Order({
- required String id,
- @JsonKey.new(defaultValue: '') required String email,
- required String currencyCode,
- @JsonKey.new(defaultValue: '') required String customerUrl,
- required LineItemsOrder lineItems,
- required String name,
- required int orderNumber,
- required String processedAt,
- required ShippingAddress? shippingAddress,
- required ShippingAddress? billingAddress,
- required String statusUrl,
- @JsonKey.new(fromJson: _priceOrZero) required PriceV2 subtotalPrice,
- required PriceV2 totalPrice,
- required PriceV2 totalShippingPrice,
- @JsonKey.new(fromJson: _priceOrZero) required PriceV2 totalTax,
- @JsonKey.new(defaultValue: '') required String financialStatus,
- required String fulfillmentStatus,
- PriceV2? totalRefunded,
- String? phone,
- String? cursor,
- String? canceledAt,
- String? cancelReason,
- List<
SuccessfulFullfilment> ? successfulFulfillments,
The order constructor
Implementation
const factory Order({
required String id,
/// Nullable on the Storefront API; empty string when absent.
@JsonKey(defaultValue: '') required String email,
required String currencyCode,
/// Nullable on the Storefront API; empty string when absent.
@JsonKey(defaultValue: '') required String customerUrl,
required LineItemsOrder lineItems,
required String name,
required int orderNumber,
required String processedAt,
required ShippingAddress? shippingAddress,
required ShippingAddress? billingAddress,
required String statusUrl,
/// Nullable on the Storefront API; zero amount when absent.
@JsonKey(fromJson: _priceOrZero) required PriceV2 subtotalPrice,
required PriceV2 totalPrice,
required PriceV2 totalShippingPrice,
/// Nullable on the Storefront API; zero amount when absent.
@JsonKey(fromJson: _priceOrZero) required PriceV2 totalTax,
/// Nullable on the Storefront API (for example on unpaid orders); empty
/// string when absent.
@JsonKey(defaultValue: '') required String financialStatus,
required String fulfillmentStatus,
PriceV2? totalRefunded,
String? phone,
String? cursor,
String? canceledAt,
String? cancelReason,
List<SuccessfulFullfilment>? successfulFulfillments,
}) = _Order;