ProductModel.fromJson constructor

ProductModel.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ProductModel.fromJson(Map<String, dynamic> json) => ProductModel(
  id: json['id'],
  name: json['name'],
  description: json['description'],
  category: json['category'],
  brand: json['brand'],
  color: json['color'],
  isAvailable: json['isAvailable'],
  quantity: json['quantity'],
  imageUrl: json['imageUrl'],
  price: json['price'],
  createdAt: DateTime.parse(json['createdAt']),
  inventoryCount: json['inventoryCount'],
  weight: json['weight'],
  dimensions: json['dimensions'],
  reviews: json['reviews'],
  rating: json['rating'],
  totalReviews: json['totalReviews'],
);