Create.fromJson constructor
Implementation
factory Create.fromJson(Map<String, dynamic> json) => Create(
id: json["id"],
name: json["name"],
slug: json["slug"],
permalink: json["permalink"],
dateCreated: DateTime.parse(json["date_created"]),
dateCreatedGmt: DateTime.parse(json["date_created_gmt"]),
dateModified: DateTime.parse(json["date_modified"]),
dateModifiedGmt: DateTime.parse(json["date_modified_gmt"]),
type: json["type"],
status: json["status"],
featured: json["featured"],
catalogVisibility: json["catalog_visibility"],
description: json["description"],
shortDescription: json["short_description"],
sku: json["sku"],
price: json["price"],
regularPrice: json["regular_price"],
salePrice: json["sale_price"],
dateOnSaleFrom: json["date_on_sale_from"],
dateOnSaleFromGmt: json["date_on_sale_from_gmt"],
dateOnSaleTo: json["date_on_sale_to"],
dateOnSaleToGmt: json["date_on_sale_to_gmt"],
priceHtml: json["price_html"],
onSale: json["on_sale"],
purchasable: json["purchasable"],
totalSales: json["total_sales"],
virtual: json["virtual"],
downloadable: json["downloadable"],
downloads: List<Download>.from(
json["downloads"].map((x) => Download.fromJson(x))),
downloadLimit: json["download_limit"],
downloadExpiry: json["download_expiry"],
externalUrl: json["external_url"],
buttonText: json["button_text"],
taxStatus: json["tax_status"],
taxClass: json["tax_class"],
manageStock: json["manage_stock"],
stockQuantity: json["stock_quantity"],
stockStatus: json["stock_status"],
backorders: json["backorders"],
backordersAllowed: json["backorders_allowed"],
backordered: json["backordered"],
soldIndividually: json["sold_individually"],
weight: json["weight"],
dimensions: Dimensions.fromJson(json["dimensions"]),
shippingRequired: json["shipping_required"],
shippingTaxable: json["shipping_taxable"],
shippingClass: json["shipping_class"],
shippingClassId: json["shipping_class_id"],
reviewsAllowed: json["reviews_allowed"],
averageRating: json["average_rating"],
ratingCount: json["rating_count"],
relatedIds: List<int>.from(json["related_ids"].map((x) => x)),
upsellIds: List<dynamic>.from(json["upsell_ids"].map((x) => x)),
crossSellIds: List<dynamic>.from(json["cross_sell_ids"].map((x) => x)),
parentId: json["parent_id"],
purchaseNote: json["purchase_note"],
categories: List<Category>.from(
json["categories"].map((x) => Category.fromJson(x))),
tags: List<dynamic>.from(json["tags"].map((x) => x)),
images: List<Image>.from(json["images"].map((x) => Image.fromJson(x))),
attributes: List<Attribute>.from(
json["attributes"].map((x) => Attribute.fromJson(x))),
defaultAttributes: List<DefaultAttribute>.from(
json["default_attributes"]
.map((x) => DefaultAttribute.fromJson(x))),
variations: List<dynamic>.from(json["variations"].map((x) => x)),
groupedProducts:
List<dynamic>.from(json["grouped_products"].map((x) => x)),
menuOrder: json["menu_order"],
metaData: List<dynamic>.from(json["meta_data"].map((x) => x)),
links: Links.fromJson(json["_links"]),
);