Product.fromGraphJson constructor

Product.fromGraphJson(
  1. Map<String, dynamic> json
)

Implementation

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