API Reference
API Reference
  1. addToFavList(String item)
    Adds an item to the favorites list.
    Parameters:

    • item: String, required – The identifier of the item to add.
    Future<MocaResult<dynamic>> addToFavList(String item);
    
  2. removeFromFavList(String item)
    Removes an item from the favorites list.
    Parameters:

    • item: String, required – The identifier of the item to remove.
    Future<MocaResult<void>> removeFromFavList(String item);
    
  3. clearFavList()
    Clears all items from the favorites list.

    Future<MocaResult<void>> clearFavList();
    
  4. addToWishList(String item)
    Adds an item to the wish list.
    Parameters:

    • item: String, required – The identifier of the item to add.
    Future<MocaResult<void>> addToWishList(String item);
    
  5. removeFromWishList(String item)
    Removes an item from the wish list.
    Parameters:

    • item: String, required – The identifier of the item to remove.
    Future<MocaResult<void>> removeFromWishList(String item);
    
  6. clearWishList()
    Clears all items from the wish list.

    Future<MocaResult<void>> clearWishList();
    
  7. addToCart(String item, {String? category, required double unitPrice, required String currency, required double quantity})
    Adds an item to the shopping cart with details such as price, currency, and quantity.
    Parameters:

    • item: String, required – The identifier of the item.
    • category: String, optional – The category of the item.
    • unitPrice: double, required – Price per unit.
    • currency: String, required – The currency code (e.g., "USD").
    • quantity: double, required – The quantity of the item.
    Future<MocaResult<void>> addToCart(String item, {String? category, required double unitPrice, required String currency, required double quantity});
    
  8. updateCart(String item, double quantity)
    Updates the quantity of an existing item in the shopping cart.
    Parameters:

    • item: String, required – The identifier of the item.
    • quantity: double, required – The updated quantity.
    Future<MocaResult<void>> updateCart(String item, double quantity);
    
  9. removeFromCart(String item)
    Removes an item from the shopping cart.
    Parameters:

    • item: String, required – The identifier of the item.
    Future<MocaResult<void>> removeFromCart(String item);
    
  10. clearCart()
    Clears all items from the shopping cart.

    Future<MocaResult<void>> clearCart();
    
  11. beginCheckout()
    Initiates the checkout process.

    Future<MocaResult<void>> beginCheckout();
    
  12. completeCheckout()
    Completes the checkout process.

    Future<MocaResult<void>> completeCheckout();
    
  13. trackPurchased(String item, {String? category, required double unitPrice, required String currency, required int quantity})
    Tracks a purchase event with details including price, currency, and quantity.
    Parameters:

    • item: String, required – The identifier of the purchased item.
    • category: String, optional – The category of the item.
    • unitPrice: double, required – Price per unit.
    • currency: String, required – The currency code.
    • quantity: int, required – The quantity purchased.
    Future<MocaResult<dynamic>> trackPurchased(String item, {String? category, required double unitPrice, required String currency, required int quantity});
    
  14. trackShared(String item)
    Tracks an event when an item is shared.
    Parameters:

    • item: String, required – The identifier of the item shared.
    Future<MocaResult<dynamic>> trackShared(String item);