CartItem class

Represents an item in a user's shopping cart.

Contains details about a product added to the cart, including quantity and farmer information.

Constructors

CartItem({required String productId, required String productName, required double price, required int quantity, required String unit, required String imageUrl, required String farmerId})
Creates a CartItem instance with required attributes.
CartItem.fromMap(Map<String, dynamic> map)
Creates a CartItem from a Firestore document map.
factory

Properties

farmerId → String
final
hashCode → int
The hash code for this object.
no setterinherited
imageUrl → String
final
price → double
final
productId → String
final
productName → String
final
quantity → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
unit → String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, dynamic>
Converts the CartItem to a map for Firestore storage.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited