getCoverArtResponse function Null safety

Future<Response> getCoverArtResponse(
  1. String mangaId,
  2. [String? coverId,
  3. int limit = 10,
  4. int offset = 0]
)

returns a https response with cover art details for a manga with given mangaId or uuid

Implementation

Future<http.Response> getCoverArtResponse(
  String mangaId, [
  String? coverId,
  int limit = 10,
  int offset = 0,
]) async {
  final mangas = '&manga[]=$mangaId';
  final covers = coverId != null ? '&cover[]=$coverId' : '';
  final uri =
      'https://$authority/cover?limit=$limit&offset=$offset$mangas$covers';
  var response = await http.get(Uri.parse(uri),
      headers: {HttpHeaders.contentTypeHeader: 'application/json'});
  return response;
}