AuthorInfo.fromJson constructor Null safety

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

Implementation

AuthorInfo.fromJson(Map<String, dynamic> json) {
  result = json['result'] ?? '';
  response = json['response'] ?? '';
  if (json['data'] != null) {
    data = Data.fromJson(json['data']);
  }
  relationships = [];
  if (json['relationships'] != null) {
    json['relationships'].forEach((e) {
      relationships.add(Relationship.fromJson(json['relationships']));
    });
  }
}