toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = id;
  data['title'] = title;
  data['method_id'] = methodId;
  data['cost'] = cost;
  data['class_cost'] = classCost;
  data['calculation_type'] = calculationType;
  data['taxable'] = taxable;
  if (shippingClasses != null) {
    data['shipping_classes'] =
        shippingClasses!.map((v) => v.toJson()).toList();
  }
  return data;
}