Product constructor
Creates a Product instance with required and optional attributes.
Parameters:
- id: The unique identifier of the product (default is empty string).
- name: The name of the product.
- description: A description of the product.
- price: The price of the product.
- unit: The unit of measurement for the product (e.g., kg, liter).
- quantity: The available quantity of the product.
- farmerId: The ID of the farmer who listed the product.
- imageUrls: A list of URLs for the product's images.
- dateAdded: The date the product was added.
- category: The category of the product.
Implementation
Product({
this.id = '',
required this.name,
required this.description,
required this.price,
required this.unit,
required this.quantity,
required this.farmerId,
required this.imageUrls,
required this.dateAdded,
required this.category,
});