toPostJson method

  1. @override
Map<String, dynamic>? toPostJson()
override

Converts the body data model to a JSON object for a POST request.

This method should be implemented by subclasses to convert their specific data to a JSON object. It should only include properties that need to be sent in a POST request.

Implementation

@override
Map<String, dynamic>? toPostJson() {
  Map<String, dynamic> data = <String, dynamic>{};
  data["title"] = title;
  data["highlightRate"] = highlightRate;
  data["slug"] = slug;
  data["link"] = link;
  data["description"] = description;
  data["discountStartDate"] = discountStartDate;
  data["discountEndDate"] = discountEndDate;
  data["limit"] = limit;
  data["showOnMain"] = showOnMain;
  data["type"] = type;
  data["priceType"] = priceType;
  data["productCount"] = productCount;
  data["freeProductCount"] = freeProductCount;
  data["photoId"] = photoId;
  data["products"] = products;
  data["brands"] = brands;
  data["categories"] = categories;
  data["tags"] = tags;
  data["storeId"] = storeId;
  return data;
}