Product.fromJson constructor
Product.fromJson(
- Map<String, dynamic> json
)
Implementation
factory Product.fromJson(Map<String, dynamic> json) {
return Product(
collectionList: _getCollectionList(json),
id: json['id'] ?? '',
title: json['title'] ?? '',
availableForSale: json['availableForSale'],
createdAt: json['createdAt'],
description: json['description'] ?? '',
productVariants: _getProductVariants(json),
descriptionHtml: json['descriptionHtml'] ?? '',
handle: json['handle'] ?? '',
onlineStoreUrl: json['onlineStoreUrl'] ?? '',
productType: json['productType'] ?? '',
publishedAt: json['publishedAt'],
tags: _getTags(json),
updatedAt: json['updatedAt'],
images: _getImageList(json),
cursor: json['cursor'],
options: _getOptionList(json),
vendor: json['vendor'],
media: _getMediaList(json),
// metafields: _getMetafieldList(json),
);
}