WooCartItem.fromJson constructor

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

Implementation

WooCartItem.fromJson(Map<String, dynamic> json) {
  key = json['key'];
  id = json['id'];
  quantity = json['quantity'];
  name = json['name'];
  sku = json['sku'];
  permalink = json['permalink'];
  if (json['images'] != null) {
    images = <WooCartItemImages>[];
    json['images'].forEach((v) {
      images!.add(new WooCartItemImages.fromJson(v));
    });
  }
  price = json['price'];
  linePrice = json['line_price'];
  variation = json['variation'].cast<String>();
}