SingleChapterData.fromJson constructor Null safety

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

Implementation

SingleChapterData.fromJson(Map<String, dynamic> json) {
  result = json['result'] ?? '';
  if (result == 'ok') {
    data = Data.fromJson(json['data']);
  } else {
    throw MangadexServerException(json);
  }
}