ChapterData.fromJson constructor Null safety

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

Implementation

ChapterData.fromJson(Map<String, dynamic> json) {
  try {
    if (json['data'] != null) {
      data = <Data>[];
      json['data'].forEach((v) {
        data.add(Data.fromJson(v));
      });
    }
    limit = json['limit'] ?? '';
    offset = json['offset'] ?? '';
    total = json['total'] ?? '';
  } on Exception {
    throw MangadexServerException(json);
  }
}