SingleChapterData.fromJson constructor Null safety
Implementation
SingleChapterData.fromJson(Map<String, dynamic> json) {
result = json['result'] ?? '';
if (result == 'ok') {
baseUrl = json['baseUrl'] ?? '';
try {
chapter = Chapter.fromJson(json['chapter']!);
} catch (e) {
throw MangadexServerException(json);
}
} else {
throw MangadexServerException(json);
}
}