ArticleComment.from constructor

ArticleComment.from(
  1. Map<String, dynamic> data
)

Implementation

ArticleComment.from(Map<String, dynamic> data)
    : isNice = data['commentNice'] ?? false,
      createTimeStr = data['commentCreateTimeStr'] ?? '',
      authorId = data['commentAuthorId'] ?? '',
      score = (data['commentScore'] ?? 0).toString(),
      createTime = data['commentCreateTime'] ?? '',
      authorURL = data['commentAuthorURL'] ?? '',
      vote = VoteStatus.values[(data['commentVote'] ?? 0) + 1],
      revisionCount = data['commentRevisionCount'] ?? 0,
      timeAgo = data['timeAgo'] ?? '',
      replyId = data['commentOriginalCommentId'] ?? '',
      sysMetal = List.from(data['sysMetal'])
          .map((e) => analyzeMetalAttr(e))
          .toList(),
      goodCnt = data['commentGoodCnt'] ?? 0,
      visible = (data['commentVisible'] ?? 0) == 0,
      articleId = data['commentOnArticleId'] ?? '',
      rewardedCnt = data['rewardedCnt'] ?? 0,
      sharpURL = data['commentSharpURL'] ?? '',
      isAnonymous = (data['commentAnonymous'] ?? 0) == 1,
      replyCnt = data['commentReplyCnt'] ?? 0,
      oId = data['oId'] ?? '',
      content = data['commentContent'] ?? '',
      status = ArticleStatus.values[data['commentStatus'] ?? 0],
      author = data['commentAuthorName'] ?? '',
      thankCnt = data['commentThankCnt'] ?? 0,
      badCnt = data['commentBadCnt'] ?? 0,
      rewarded = data['rewarded'] ?? false,
      thumbnailURL = data['commentAuthorThumbnailURL'] ?? '',
      audioURL = data['commentAudioURL'] ?? '',
      offered = data['commentQnAOffered'] ?? 0,
      commenter = CommentAuthor.from(data['commenter'] ?? {});