UCommentResponse.fromMap constructor
UCommentResponse.fromMap(
- Map<String, dynamic> json
)
Implementation
factory UCommentResponse.fromMap(Map<String, dynamic> json) => UCommentResponse(
id: json["id"],
createdAt: DateTime.parse(json["createdAt"]),
jsonData: UCommentJson.fromMap(json["jsonData"]),
tags: List<int>.from(json["tags"].map((dynamic x) => x)),
score: json["score"],
description: json["description"],
parentId: json["parentId"],
user: json["user"] == null ? null : UUserResponse.fromMap(json["user"]),
userId: json["userId"],
creator: json["creator"] == null ? null : UUserResponse.fromMap(json["creator"]),
creatorId: json["creatorId"],
productId: json["productId"],
blogId: json["blogId"],
children: json["children"] == null ? <UCommentResponse>[] : List<UCommentResponse>.from(json["children"].map((dynamic x) => UCommentResponse.fromMap(x))),
media: json["media"] == null ? <UMediaResponse>[] : List<UMediaResponse>.from(json["media"].map((dynamic x) => UMediaResponse.fromMap(x))),
adminUserIds: json["adminUserIds"] == null ? <String>[] : List<String>.from(json["adminUserIds"]!.map((dynamic x) => x)),
);