FlatRate.fromJson constructor

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

Implementation

FlatRate.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  title = json['title'];
  methodId = json['method_id'];
  cost = json['cost'];
  classCost = json['class_cost'];
  calculationType = json['calculation_type'];
  taxable = json['taxable'];
  if (json['shipping_classes'] != null) {
    shippingClasses = [];
    json['shipping_classes'].forEach((v) {
      shippingClasses!.add(ShippingClasses.fromJson(v));
    });
  }
}