CartService class
Manages cart operations for a specific user in Firestore.
Provides methods to add, remove, update, and clear cart items, as well as retrieve a stream of cart items.
Constructors
- CartService(String userId)
- Creates a CartService instance for a specific user.
Properties
Methods
-
addToCart(
CartItem cartItem) → Future< void> - Adds an item to the user's cart in Firestore.
-
clearCart(
) → Future< void> - Clears all items from the user's cart in Firestore.
-
getCartItems(
) → Stream< List< CartItem> > - Retrieves a stream of the user's cart items from Firestore.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeFromCart(
String productId) → Future< void> - Removes an item from the user's cart in Firestore.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateCartItemQuantity(
String productId, int newQuantity) → Future< void> - Updates the quantity of a cart item in Firestore.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited