CartModel.fromJson constructor

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

Implementation

factory CartModel.fromJson(Map<String, dynamic> json) => CartModel(
  productId: json["product_id"],
  price: json["price"]?.toDouble(),
  priceNoVat: json["priceNoVat"]?.toDouble(),
  title: json["title"],
  image: json["image"],
  quantity: json["quantity"],
  variants: json["variants"] == null ? [] : List<Variant>.from(json["variants"]!.map((x) => Variant.fromJson(x))),
  totalItem: json["totalItem"],
  exemptVat: json["exemptVat"],
  totalPrice: json["totalPrice"]?.toDouble(),
);