Results.fromJson constructor
Results.fromJson(
- Map<String, dynamic> json
)
Implementation
Results.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
slug = json['slug'];
stockQuantity = null;
sku = null;
upc = null;
isActive = json['is_active'];
isFeatured = json['is_featured'];
description = null;
shortDescription = null;
type = json['type'];
price = json['price'];
specialPrice = null;
allowSubscription = json['allow_subscription'];
categories = List.from(json['categories'])
.map((e) => Categories.fromJson(e))
.toList();
tags = List.castFrom<dynamic, dynamic>(json['tags']);
productImages = List.from(json['product_images'])
.map((e) => ProductImages.fromJson(e))
.toList();
weight = null;
dimension = null;
productOptions = List.castFrom<dynamic, dynamic>(json['product_options']);
store = Store.fromJson(json['store']);
purchaseNote = null;
upsellProducts = List.castFrom<dynamic, dynamic>(json['upsell_products']);
crossSellProducts =
List.castFrom<dynamic, dynamic>(json['cross_sell_products']);
externalUrl = json['external_url'];
externalButtonText = json['external_button_text'];
formattedPrices = FormattedPrices.fromJson(json['formatted_prices']);
additional = (json['additional'] == null
? null
: Additional.fromJson(json['additional']))!;
createdAt = json['created_at'];
updatedAt = json['updated_at'];
url = json['url'];
}