toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() => <String, dynamic>{
      "id": id,
      "createdAt": createdAt.toIso8601String(),
      "updatedAt": updatedAt.toIso8601String(),
      "jsonData": jsonData.toMap(),
      "tags": List<dynamic>.from(tags.map((int x) => x)),
      "title": title,
      "code": code,
      "subtitle": subtitle,
      "description": description,
      "slug": slug,
      "type": type,
      "point": point,
      "content": content,
      "latitude": latitude,
      "longitude": longitude,
      "stock": stock,
      "price": price,
      "parentId": parentId,
      "parent": parent?.toMap(),
      "userId": userId,
      "commentCount": commentCount,
      "isFollowing": isFollowing,
      "visitCount": visitCount,
      "childrenCount": childrenCount,
      "user": user?.toMap(),
      "children": children == null ? null : List<dynamic>.from(children!.map((UProductResponse x) => x.toMap())),
      "media": media == null ? null : List<dynamic>.from(media!.map((UMediaResponse x) => x.toMap())),
      "categories": categories == null ? null : List<dynamic>.from(categories!.map((UCategoryResponse x) => x.toMap())),
    };