DetailedVersion.fromJson constructor

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

Implementation

factory DetailedVersion.fromJson(Map<String, Object?> json) {
  return DetailedVersion(
    number: (json[r'number'] as num?)?.toInt(),
    authorId: json[r'authorId'] as String?,
    message: json[r'message'] as String?,
    createdAt: DateTime.tryParse(json[r'createdAt'] as String? ?? ''),
    minorEdit: json[r'minorEdit'] as bool? ?? false,
    contentTypeModified: json[r'contentTypeModified'] as bool? ?? false,
    collaborators: (json[r'collaborators'] as List<Object?>?)
            ?.map((i) => i as String? ?? '')
            .toList() ??
        [],
    prevVersion: (json[r'prevVersion'] as num?)?.toInt(),
    nextVersion: (json[r'nextVersion'] as num?)?.toInt(),
  );
}