toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() => <String, dynamic>{
  "title": title,
  "code": code,
  "subtitle": subtitle,
  "description": description,
  "actionType": actionType,
  "actionTitle": actionTitle,
  "actionUri": actionUri,
  "slug": slug,
  "type": type,
  "content": content,
  "latitude": latitude,
  "longitude": longitude,
  "stock": stock,
  "details": details,
  "tags": List<dynamic>.from(tags.map((dynamic x) => x)),
  "categories": categories == null ? null : List<dynamic>.from(categories!.map((dynamic x) => x)),
  "relatedProducts": relatedProducts == null ? null : List<dynamic>.from(relatedProducts!.map((dynamic x) => x)),
  "parentId": parentId,
  "creatorId": creatorId,
  "point": point,
  "phoneNumber": phoneNumber,
  "address": address,
  "detail1": detail1,
  "detail2": detail2,
  "id": id,
  "adminUserIds": adminUserIds == null ? <dynamic>[] : List<dynamic>.from(adminUserIds!.map((String x) => x)),
  "order": order,
  "children": children == null ? <UProductCreateParams>[] : List<UProductCreateParams>.from(children!.map((UProductCreateParams x) => x.toMap())),
  "media": media == null ? <dynamic>[] : List<dynamic>.from(media!.map((String x) => x)),
};