toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = {};
  data['description'] = description;
  data['name'] = name;
  if (unitPrice != null) {
    data['unitPrice'] = unitPrice!.toJson();
  }
  data['quantity'] = quantity;
  if (total != null) {
    data['total'] = total!.toJson();
  }
  data['details'] = details;
  return data;
}