getAllReadChaptersForAListOfManga function Null safety

Future<Response> getAllReadChaptersForAListOfManga(
  1. String token,
  2. List<String> mangaIds
)

Implementation

Future<http.Response> getAllReadChaptersForAListOfManga(
    String token, List<String> mangaIds) async {
  // get all read chapters in the given mangaIds,
  // please note it returns an http response since the response is not always of the same schema.
  var unencodedPath = '/manga/read';
  var _ids = '';
  mangaIds.forEach((element) {
    _ids = _ids + '&ids[]=$element';
  });
  final uri = 'https://$authority$unencodedPath?$_ids';
  var response = await http.get(Uri.parse(uri), headers: {
    HttpHeaders.contentTypeHeader: 'application/json',
    HttpHeaders.authorizationHeader: 'Bearer $token'
  });
  return response;
}