Changelog.fromJson constructor

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

Implementation

factory Changelog.fromJson(Map<String, Object?> json) {
  return Changelog(
    author: json[r'author'] != null
        ? UserDetails.fromJson(json[r'author']! as Map<String, Object?>)
        : null,
    created: DateTime.tryParse(json[r'created'] as String? ?? ''),
    historyMetadata: json[r'historyMetadata'] != null
        ? HistoryMetadata.fromJson(
            json[r'historyMetadata']! as Map<String, Object?>)
        : null,
    id: json[r'id'] as String?,
    items: (json[r'items'] as List<Object?>?)
            ?.map((i) => ChangeDetails.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
  );
}