Cart constructor

const Cart({
  1. required String id,
  2. required String? checkoutUrl,
  3. required CartCost? cost,
  4. required int? totalQuantity,
  5. required List<CartDiscountCode?>? discountCodes,
  6. required String? createdAt,
  7. List<Attribute?>? attributes,
  8. CartBuyerIdentity? buyerIdentity,
  9. CartDelivery? delivery,
  10. String? note,
  11. String? updatedAt,
  12. @JsonKey.new(fromJson: JsonHelper.lines) required List<Line> lines,
})

The cart constructor

Implementation

const factory Cart({
  required String id,
  required String? checkoutUrl,
  required CartCost? cost,
  required int? totalQuantity,
  required List<CartDiscountCode?>? discountCodes,
  required String? createdAt,
  List<Attribute?>? attributes,
  CartBuyerIdentity? buyerIdentity,

  /// Delivery addresses on the cart. Replaces the deprecated
  /// `buyerIdentity.deliveryAddressPreferences`.
  CartDelivery? delivery,
  String? note,
  String? updatedAt,
  @JsonKey(fromJson: JsonHelper.lines) required List<Line> lines,
}) = _Cart;