Cart class abstract
The cart
- Available extensions
- Annotations
-
- @freezed
Constructors
-
Cart({required String id, required String? checkoutUrl, required CartCost? cost, required int? totalQuantity, required List<
CartDiscountAllocation?> ? discountAllocations, required List<CartDiscountCode?> ? discountCodes, required String? createdAt, List<Attribute?> ? attributes, CartBuyerIdentity? buyerIdentity, String? note, String? updatedAt, @JsonKey.new(fromJson: JsonHelper.lines) required List<Line> lines}) -
The cart constructor
constfactory
-
Cart.fromJson(Map<
String, dynamic> json) -
The cart from json
factory
Properties
-
attributes
→ List<
Attribute?> ? -
no setterinherited
- buyerIdentity → CartBuyerIdentity?
-
no setterinherited
- checkoutUrl → String?
-
no setterinherited
-
copyWith
→ $CartCopyWith<
Cart> -
Create a copy of Cart
with the given fields replaced by the non-null parameter values.
no setterinherited
- cost → CartCost?
-
no setterinherited
- createdAt → String?
-
no setterinherited
-
discountAllocations
→ List<
CartDiscountAllocation?> ? -
no setterinherited
-
discountCodes
→ List<
CartDiscountCode?> ? -
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
no setterinherited
-
lines
→ List<
Line> -
no setterinherited
- note → String?
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- totalQuantity → int?
-
no setterinherited
- updatedAt → String?
-
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_Cart value)) → TResult -
Available on Cart, provided by the CartPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_Cart value)?) → TResult? -
Available on Cart, provided by the CartPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_Cart value)?, {required TResult orElse()}) → TResult -
Available on Cart, provided by the CartPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(String id, String? checkoutUrl, CartCost? cost, int? totalQuantity, List< CartDiscountAllocation?> ? discountAllocations, List<CartDiscountCode?> ? discountCodes, String? createdAt, List<Attribute?> ? attributes, CartBuyerIdentity? buyerIdentity, String? note, String? updatedAt, List<Line> lines)?, {required TResult orElse()}) → TResult -
Available on Cart, provided by the CartPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this Cart to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(String id, String? checkoutUrl, CartCost? cost, int? totalQuantity, List< CartDiscountAllocation?> ? discountAllocations, List<CartDiscountCode?> ? discountCodes, String? createdAt, List<Attribute?> ? attributes, CartBuyerIdentity? buyerIdentity, String? note, String? updatedAt, List<Line> lines)) → TResult -
Available on Cart, provided by the CartPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(String id, String? checkoutUrl, CartCost? cost, int? totalQuantity, List< CartDiscountAllocation?> ? discountAllocations, List<CartDiscountCode?> ? discountCodes, String? createdAt, List<Attribute?> ? attributes, CartBuyerIdentity? buyerIdentity, String? note, String? updatedAt, List<Line> lines)?) → TResult? -
Available on Cart, provided by the CartPatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited