Comment.fromJson constructor

Comment.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Comment.fromJson(Map<String, dynamic> json) {
  return Comment(
    authorArn: json['authorArn'] as String?,
    callerReactions: (json['callerReactions'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    clientRequestToken: json['clientRequestToken'] as String?,
    commentId: json['commentId'] as String?,
    content: json['content'] as String?,
    creationDate: timeStampFromJson(json['creationDate']),
    deleted: json['deleted'] as bool?,
    inReplyTo: json['inReplyTo'] as String?,
    lastModifiedDate: timeStampFromJson(json['lastModifiedDate']),
    reactionCounts: (json['reactionCounts'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as int)),
  );
}