CartListResponseModel.fromJson constructor
CartListResponseModel.fromJson(
- dynamic json
Implementation
CartListResponseModel.fromJson(dynamic json) {
if (json['data'] != null) {
data = [];
json['data'].forEach((v) {
data?.add(CartItems.fromJson(v));
});
}
totalItem = json['total_item'];
subTotal = json['sub_total'];
discount = json['discount'];
discountDisplay = json['discount_display'];
discountPrice = json['discount_price'];
sgst = json['sgst'];
cgst = json['cgst'];
igst = json['igst'];
roundingOff = json['rounding_off'];
grandTotal = json['grand_total'];
totalRecords = json['total_records'];
if (json['summary'] != null) {
summary = [];
json['summary'].forEach((v) {
summary?.add(Summary.fromJson(v));
});
}
if (json['free_product'] != null) {
freeProduct = [];
json['free_product'].forEach((v) {
freeProduct?.add(FreeProduct.fromJson(v));
});
}
freeProductTotal = json['free_product_total'] != null ? FreeProductTotal.fromJson(json['free_product_total']) : null;
success = json['success'];
message = json['message'];
userWiseChanges = json['user_wise_changes'] != null ? UserWiseChanges.fromJson(json['user_wise_changes']) : null;
requirePrescription = json['require_prescription'] != null ? RequirePrescription.fromJson(json['require_prescription']) : null;
}