fromData static method
Implementation
static KhasProductsDetails fromData({
required String productId, // Unique identifier for the product
required String productName, // Name of the product
required String productDescription, // Description of the product
required double productPrice,// Price of the product
required String productCategory,// Category of the product (e.g., Electronics, Furniture)
required int stockQuantity, // Quantity of the product in stock
required bool isAvailable, // Indicates if the product is available (true) or not (false)
required List<MediaContent>? media // List of media files related to the product
}){
final productDetail = KhasProductsDetails()
..isAvailable = isAvailable
..productCategory = productCategory
..productDescription = productDescription
..productPrice = productPrice
..stockQuantity = stockQuantity
..productName = productName
..productId = productId;
if(media !=null){
productDetail.media?.addAll(media);
}
return productDetail;
}