toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['product_id'] = productId;
  data['name'] = name;
  if (variationId != null) {
    data['variation_id'] = variationId;
  }
  if (taxClass != null) {
    data['tax_class'] = taxClass;
  }
  if (subtotal != null) {
    data['subtotal'] = subtotal;
  }
  if (data['total'] != null) {
    data['total'] = total;
  }
  data['quantity'] = quantity;
  return data;
}