ListingItem.fromJson(- Map<String, dynamic> json
)
Implementation
factory ListingItem.fromJson(Map<String, dynamic> json) => ListingItem(
rating: json["rating"],
colorOptions: json["colorOptions"],
sizes: json["sizes"] == null
? null
: List<Size>.from(json["sizes"].map((x) => Size.fromJson(x))),
colors: json["colors"] == null
? null
: List<ColorModel>.from(
json["colors"].map((x) => ColorModel.fromJson(x))),
preOrder: json["preOrder"],
availabilityDate: json["availabilityDate"] == null
? null
: DateTime.parse(json["availabilityDate"]),
id: json["id"],
productId: json["productID"],
productCode: json["productCode"],
imageUrl: json["imageUrl"],
imageThumbUrl: json["imageThumbUrl"],
title: json["title"],
seoTitle: json["seoTitle"],
isOutOfStock: json["isOutOfStock"],
price: json["price"] == null ? null : json["price"]!.toDouble(),
finalPrice:
json["finalPrice"] == null ? null : json["finalPrice"]!.toDouble(),
hasDiscount: json["hasDiscount"],
discountValue: json["discountValue"],
discountType: json["discountType"],
promoText: json["promoText"],
bogoPromoText: json["bogoPromoText"],
croppedImageUrl: json["croppedImageURL"],
enableCropping: json["enableCropping"],
size: json["size"],
sizeId: json["sizeID"],
colorHexaCode: json["colorHexaCode"],
color: json["color"],
colorId: json["colorID"],
);