ProductItem.fromJson constructor

ProductItem.fromJson(
  1. dynamic data
)

Implementation

factory ProductItem.fromJson(dynamic data) {
  var json = DynamicJsonExtension.getJsonMap(data);
  return ProductItem(
    name: json['name'],
    type: json['type'],
    amount: json['amount'],
    category: json['category'],
    quantity: json['quantity'],
    description: json['description'],
    subcategory: json['subcategory'],
    referenceId: json['reference_id'] ?? json['referenceId'],
  );
}