StockHistory.fromJson constructor

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

Implementation

StockHistory.fromJson(Map<String, dynamic> json) {
  id = json['Id'];
  category = json['category'];
  externalId = json['externalId'];
  priority = json['priority'];
  orderDate = json['orderDate'];
  state = json['state'];
  if (json['channel'] != null) {
    channel = <Channel>[];
    json['channel'].forEach((v) {
      channel!.add(new Channel.fromJson(v));
    });
  }
  if (json['orderTotalPrice'] != null) {
    orderTotalPrice = <OrderTotalPrice>[];
    json['orderTotalPrice'].forEach((v) {
      orderTotalPrice!.add(new OrderTotalPrice.fromJson(v));
    });
  }
  if (json['productOrderItem'] != null) {
    productOrderItem = <ProductOrderItem>[];
    json['productOrderItem'].forEach((v) {
      productOrderItem!.add(new ProductOrderItem.fromJson(v));
    });
  }
  if (json['relatedParty'] != null) {
    relatedParty = <RelatedParty>[];
    json['relatedParty'].forEach((v) {
      relatedParty!.add(new RelatedParty.fromJson(v));
    });
  }
  idNbr = json['idNbr'];
}