ShopifyCart class
ShopifyCart provides various method in order to work with carts.
- Mixed-in types
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addDeliveryAddresses(
{required String cartId, bool includeProductDetails = true, required List< CartSelectableAddressInput> addresses, bool reverse = false}) → Future<Cart> - Adds delivery addresses to an existing cart.
-
addLineItemsToCart(
{required String cartId, bool includeProductDetails = true, required List< CartLineUpdateInput> cartLineInputs, bool reverse = false}) → Future<Cart> - add line item to cart
-
checkForError(
QueryResult< Object?> queryResult, {String? key, String? errorKey}) → void -
throws a ShopifyException if the operation failed or shopify reports an
error.
inherited
-
createCart(
CartInput cartInput, {bool includeProductDetails = true}) → Future< Cart> - create cart
-
getCartById(
String cartId, {bool reverse = false, bool includeProductDetails = true}) → Future< Cart?> -
When
includeProductDetailsis false, each line'smerchandise.productomits its fullvariantsandmedialists (the bulk of the payload).product.title/handle/imagesare still returned, but the getters derived from variants —product.price,formattedPrice,isAvailableForSale— become 0/false. Read price and availability from the line'smerchandise(.price,.availableForSale) instead. Available on every cart method; defaults to true (full payload, unchanged behaviour). TODO(5.0): flip the default to false — the product block is otherwise unused. Returns a Cart object. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeLineItemsFromCart(
{required String cartId, bool includeProductDetails = true, required List< String> lineIds, bool reverse = false}) → Future<Cart> - remove line item from cart
-
toString(
) → String -
A string representation of this object.
inherited
-
updateBuyerIdentityInCart(
{required String cartId, bool includeProductDetails = true, required CartBuyerIdentityInput buyerIdentity, bool reverse = false}) → Future< Cart> - update Buyer identity in cart
-
updateCartAttributes(
{required String cartId, bool includeProductDetails = true, required List< AttributeInput> attributes, bool reverse = false}) → Future<Cart> - update cart atributes
-
updateCartDiscountCodes(
{required String cartId, bool includeProductDetails = true, required List< String> discountCodes, bool reverse = false, bool includeWarnings = false}) → Future<Cart> - update cart discount codes
-
updateLineItemsInCart(
{required String cartId, bool includeProductDetails = true, required List< CartLineUpdateInput> cartLineInputs, bool reverse = false}) → Future<Cart> - update line items in cart
-
updateNoteInCart(
{required String cartId, bool includeProductDetails = true, required String note, bool reverse = false}) → Future< Cart> - update note in cart
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → ShopifyCart
-
Singleton instance of ShopifyCart
final