Attributes.fromJson constructor Null safety

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

Implementation

Attributes.fromJson(Map<String, dynamic> json) {
  if (json['title'] != null) {
    title = Title.fromJson(json['title']);
  }
  altTitles = <AltTitles>[];
  if (json['altTitles'] != null) {
    json['altTitles'].forEach((v) {
      altTitles.add(AltTitles.fromJson(v));
    });
  }
  if (json['description'] != null) {
    description = Description.fromJson(json['description']);
  }
  isLocked = json['isLocked'] ?? true;
  originalLanguage = json['originalLanguage'] ?? '';
  lastVolume = json['lastVolume'] ?? '';
  lastChapter = json['lastChapter'] ?? '';
  publicationDemographic = json['publicationDemographic'] ?? '';
  status = json['status'] ?? '';
  year = json['year'] ?? 0;
  contentRating = json['contentRating'] ?? '';
  tags = <Tags>[];
  if (json['tags'] != null) {
    json['tags'].forEach((v) {
      tags.add(Tags.fromJson(v));
    });
  }
  createdAt = json['createdAt'] ?? '';
  updatedAt = json['updatedAt'] ?? '';
  version = json['version'] ?? '';
}