BlogPostVersion.fromJson constructor

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

Implementation

factory BlogPostVersion.fromJson(Map<String, Object?> json) {
  return BlogPostVersion(
    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?,
    blogpost: json[r'blogpost'] != null
        ? VersionedEntity.fromJson(json[r'blogpost']! as Map<String, Object?>)
        : null,
  );
}