WooProductVariation.fromJson constructor
WooProductVariation.fromJson(
- Map<String, dynamic> json
)
Implementation
WooProductVariation.fromJson(Map<String, dynamic> json)
: id = json['id'],
permalink = json['permalink'],
status = json['status'],
description = json['description'],
sku = json['sku'],
price = json['price'],
regularPrice = json['regular_price'],
salePrice = json['sale_price'],
onSale = json['on_sale'],
purchasable = json['purchasable'],
virtual = json['virtual'],
downloadable = json['downloadable'],
downloads = (json['downloads'] as List)
.map((i) => WooProductVariationDownload.fromJson(i))
.toList(),
downloadLimit = json['download_limit'],
downloadExpiry = json['download_expiry'],
taxStatus = json['tax_status'],
taxClass = json['tax_class'],
manageStock = (json['manage_stock'] != null && json['manage_stock'] is bool) ? json['manage_stock'] : false,
stockQuantity = json['stock_quantity'],
stockStatus = json['stock_status'],
backorders = json['backorders'],
backordersAllowed = json['backorders_allowed'],
backordered = json['backordered'],
weight = json['weight'],
dimensions = WooProductVariationDimension.fromJson(json['dimensions']),
shippingClass = json['shipping_class'],
shippingClassId = json['shipping_class_id'],
menuOrder = json['menu_order'],
attributes = (json['attributes'] as List)
.map((i) => WooProductVariationAttribute.fromJson(i))
.toList(),
metaData = (json['meta_data'] as List)
.map((i) => WooProductVariationMetaData.fromJson(i))
.toList();