toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = id;
  data['type'] = type;
  data['highlightRate'] = highlightRate;
  data['useStock'] = useStock;
  if (categories != null) {
    data['categories'] = categories!.map((v) => v.toJson()).toList();
  }
  if (brand != null) {
    data['brand'] = brand!.toJson();
  }
  return data;
}