toMap method
Implementation
Map<String, dynamic> toMap() => {
"pricing": pricing?.toMap(),
"inventory": inventory?.toMap(),
"extra": extra,
"id": id,
"title": title,
"slug": slug,
"code": code,
"gender": gender,
"description": description,
"created_at": createdAt,
"specifications": specifications,
"updated_at": updatedAt,
"free_delivery": freeDelivery,
"exempt_vat": exemptVat,
"has_variants": hasVariants,
"checkout_message": checkoutMessage,
"demo_link": demoLink,
"demo_link_type": demoLinkType,
"age_group": ageGroup,
"seo_url": seoUrl,
"short_url": shortUrl,
"seo_desc": seoDesc,
"seo_tags": seoTags,
"seo_title": seoTitle,
"tags": tags,
"shipping_duration_max": shippingDurationMax,
"shipping_duration_metric": shippingDurationMetric,
"shipping_required": shippingRequired,
"shipping_duration_min": shippingDurationMin,
"weight": weight,
"price": price,
"qty": qty,
"weight_unit": weightUnit,
"status": status,
"main_image_id": mainImageId,
"has_expiry": hasExpiry,
"expiry_date": expiryDate,
"manufacturing_date": manufacturingDate,
"product_type_code": productTypeCode,
"max_billing_count": maxBillingCount,
"billing_cycle": billingCycle,
"category_id": categoryId,
"brand_id": brandId,
"warehouse_id": warehouseId,
"supplier_id": supplierId,
"images": images == null ? [] : List<dynamic>.from(images!.map((x) => x.toMap())),
"variants": variants == null ? [] : List<dynamic>.from(variants!.map((x) => x.toMap())),
"variant_combinations": variantCombinations == null ? [] : List<dynamic>.from(variantCombinations!.map((x) => x.toMap())),
"is_default": isDefault,
"share_links": shareLinks,
"related_products": relatedProducts,
"product_type": productType,
"category": category,
"brand": brand,
"supplier": supplier,
"collections": collections == null ? [] : List<dynamic>.from(collections!.map((x) => x)),
"sales_channels": salesChannels == null ? [] : List<dynamic>.from(salesChannels!.map((x) => x)),
"downloadables": downloadables == null ? [] : List<dynamic>.from(downloadables!.map((x) => x)),
"warehouse": warehouse,
"medium_image_url": mediumImageUrl,
"thumbnail_image_url": thumbnailImageUrl,
};