Product class

Represents a product in the application.

Contains details such as name, description, price, and other attributes associated with a product listed by a farmer.

Constructors

Product({String id = '', required String name, required String description, required double price, required String unit, required int quantity, required String farmerId, required List<String> imageUrls, required DateTime dateAdded, required String category})
Creates a Product instance with required and optional attributes.
Product.fromMap(Map<String, dynamic> map, String id)
Creates a Product from a Firestore document map.
factory

Properties

category → String
final
dateAdded → DateTime
final
description → String
final
farmerId → String
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
final
imageUrls → List<String>
final
name → String
final
price → double
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 Product to a map for Firestore storage.
toString() → String
A string representation of this object.
inherited

Operators

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