CartItem constructor

CartItem({
  1. required String productId,
  2. required String productName,
  3. required double price,
  4. required int quantity,
  5. required String unit,
  6. required String imageUrl,
  7. required String farmerId,
})

Creates a CartItem instance with required attributes.

Parameters:

  • productId: The ID of the product in the cart.
  • productName: The name of the product.
  • price: The price of the product.
  • quantity: The quantity of the product in the cart.
  • unit: The unit of measurement for the product.
  • imageUrl: The URL of the product's image.
  • farmerId: The ID of the farmer who listed the product.

Implementation

CartItem({
  required this.productId,
  required this.productName,
  required this.price,
  required this.quantity,
  required this.unit,
  required this.imageUrl,
  required this.farmerId,
});