Discounts.fromJson constructor

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

Implementation

Discounts.fromJson(Map<String, dynamic> json) {
  name = json['name'];
  id = json['id'];
  unitPrice = json['unitPrice'] != null
      ? new UnitPrice.fromJson(json['unitPrice'])
      : null;
  totalPrice = json['totalPrice'] != null
      ? new UnitPrice.fromJson(json['totalPrice'])
      : null;
  quantity = json['quantity'];
  priceType = json['priceType'];
  discountPercentage = json['discountPercentage'];
}