getCoverArt function Null safety

Future<Cover> getCoverArt(
  1. String mangaId
)

returns an Cover class instance containing cover art details for a manga with given mangaId or uuid

Implementation

Future<Cover> getCoverArt(String mangaId) async {
  var response = await getCoverArtResponse(mangaId);
  try {
    return Cover.fromJson(jsonDecode(response.body));
  } on Exception {
    throw MangadexServerException(jsonDecode(response.body));
  }
}