CommentVersion.fromJson constructor

CommentVersion.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory CommentVersion.fromJson(Map<String, Object?> json) {
  return CommentVersion(
    createdAt: DateTime.tryParse(json[r'createdAt'] as String? ?? ''),
    message: json[r'message'] as String?,
    number: (json[r'number'] as num?)?.toInt(),
    minorEdit: json[r'minorEdit'] as bool? ?? false,
    authorId: json[r'authorId'] as String?,
    comment: json[r'comment'] != null
        ? VersionedEntity.fromJson(json[r'comment']! as Map<String, Object?>)
        : null,
  );
}