UCommentResponse.fromMap constructor

UCommentResponse.fromMap(
  1. Map<String, dynamic> json
)

Implementation

factory UCommentResponse.fromMap(Map<String, dynamic> json) => UCommentResponse(
      id: json["id"],
      createdAt: DateTime.parse(json["createdAt"]),
      updatedAt: DateTime.parse(json["updatedAt"]),
      jsonData: UCommentJson.fromMap(json["jsonData"]),
      tags: List<int>.from(json["tags"].map((dynamic x) => x)),
      score: json["score"],
      description: json["description"],
      parentId: json["parentId"],
      parent: json["parent"] == null ? null : UCommentResponse.fromMap(json["parent"]),
      user: json["user"] == null ? null : UUserResponse.fromMap(json["user"]),
      userId: json["userId"],
      targetUser: json["targetUser"] == null ? null : UUserResponse.fromMap(json["targetUser"]),
      targetUserId: json["targetUserId"],
      product: json["product"] == null ? null : UProductResponse.fromMap(json["product"]),
      productId: json["productId"],
      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))),
    );