toMap method
Implementation
Map<String, dynamic> toMap() {
return {
"timeList": timeList,
"id": id,
"name": name,
"slug": slug,
"permalink": permalink,
"type": type,
"status": status,
"featured": featured,
"catalogVisibility": catalogVisibility,
"description": description,
"short_description": shortDescription,
"sku": sku,
"price": Productprice,
"regular_price": Price,
"sale_Price": salePrice,
"priceHtml": priceHtml,
"onSale": onSale,
"purchasable": purchasable,
"totalSales": totalSales,
"virtual": virtual,
"downloadable": downloadable,
"downloads": downloads,
"downloadLimit": downloadLimit,
"downloadExpiry": downloadExpiry,
"externalUrl": externalUrl,
"buttonText": buttonText,
"taxStatus": taxStatus,
"taxClass": taxClass,
"manageStock": manageStock,
"stockQuantity": stockQuantity,
"stockStatus": stockStatus,
"backorders": backorders,
"backordersAllowed": backordersAllowed,
"backordered": backordered,
"soldIndividually": soldIndividually,
"weight": weight,
"dimensions": dimensions,
"shippingRequired": shippingRequired,
"shippingTaxable": shippingTaxable,
"shippingClass": shippingClass,
"shippingClassId": shippingClassId,
"reviewsAllowed": reviewsAllowed,
"averageRating": averageRating,
"ratingCount": ratingCount,
"relatedIds": relatedIds,
"upsellIds": upsellIds,
"crossSellIds": crossSellIds,
"parentId": parentId,
"purchaseNote": purchaseNote,
'images': images != null ? images!.map((i) => i.toJson()).toList() : [],
'categories':
// 'categories': categories,
categories != null ? categories!.map((i) => i.toJson()).toList() : [],
'tags': tags != null ? tags!.map((i) => i.toJson()).toList() : [],
"attributes": attributes,
"defaultAttributes": defaultAttributes,
"variations": variations,
"groupedProducts": groupedProducts,
"menuOrder": menuOrder,
"metaData": metaData,
"dateCreated": dateCreated,
"dateCreatedGMT": dateCreatedGMT,
};
}