toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = {};
  if (handlingFee != null) {
    data['handlingFee'] = handlingFee!.toJson();
  }
  if (insurance != null) {
    data['insurance'] = insurance!.toJson();
  }
  if (shippingAndHandling != null) {
    data['shippingAndHandling'] = shippingAndHandling!.toJson();
  }
  if (shippingDiscount != null) {
    data['shippingDiscount'] = shippingDiscount!.toJson();
  }
  if (subtotal != null) {
    data['subtotal'] = subtotal!.toJson();
  }
  if (tax != null) {
    data['tax'] = tax!.toJson();
  }
  if (total != null) {
    data['total'] = total!.toJson();
  }
  return data;
}