CartItemModel.fromJson constructor Null safety

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

Implementation

factory CartItemModel.fromJson(Map<String, dynamic> json) => CartItemModel(
      maxQty: json["maxQty"],
      imageId: json["imageID"],
      freeBogo: json["freeBOGO"],
      discountBogoid: json["discountBOGOID"],
      addedForDiscountBogo: json["addedForDiscountBOGO"],
      stock: json["stock"],
      qty: json["qty"],
      minDeliveryPeriod: json["minDeliveryPeriod"],
      maxDeliveryPeriod: json["maxDeliveryPeriod"],
      periodName: json["periodName"],
      deliveryNote: json["deliveryNote"],
      preOrder: json["preOrder"],
      availabilityDate: 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"],
    );