getChaptersResponse function Null safety

Future<Response> getChaptersResponse(
  1. String mangaId,
  2. {String? ids,
  3. String? title,
  4. String? groups,
  5. String? uploader,
  6. String? volume,
  7. String? chapter,
  8. String? translatedLanguage,
  9. String? createdAtSince,
  10. String? updatedAtSince,
  11. String? publishedAtSince,
  12. String? includes,
  13. int? limit,
  14. int? offset}
)

Implementation

Future<http.Response> getChaptersResponse(String mangaId,
    {String? ids,
    String? title,
    String? groups,
    String? uploader,
    String? volume,
    String? chapter,
    String? translatedLanguage,
    String? createdAtSince,
    String? updatedAtSince,
    String? publishedAtSince,
    String? includes,
    int? limit,
    int? offset}) async {
  var unencodedPath = '/chapter';
  var MangaId = mangaId;
  var Limit = limit != null ? '&limit=$limit' : '&limit=10';
  var Offset = offset != null ? '&offset=$offset' : '&offset=0';
  var Ids = ids != null ? '&ids[]=$ids' : '';
  var Title = title != null ? '&title=$title' : '';
  var Groups = groups != null ? '&groups[]=$groups' : '';
  var Uploader = uploader != null ? '&uploader=$uploader' : '';
  var Volume = volume != null ? '&volume=$volume' : '';
  var Chapter = chapter != null ? '&chapter=$chapter' : '';
  var TranslatedLanguage = translatedLanguage != null
      ? '&translatedLanguage[]=$translatedLanguage'
      : '';
  var CreatedAtSince =
      createdAtSince != null ? '&createdAtSince=$createdAtSince' : '';
  var UpdatedAtSince =
      updatedAtSince != null ? '&updatedAtSince=$updatedAtSince' : '';
  var PublishedAtSince =
      publishedAtSince != null ? '&publishedAtSince=$publishedAtSince' : '';
  var Includes = includes != null ? '&includes[]=$includes' : '';

  final url =
      'https://$authority$unencodedPath?&manga=$MangaId$Limit$Offset$Ids$Title$Groups$Uploader$Volume$Chapter$TranslatedLanguage$CreatedAtSince$UpdatedAtSince$PublishedAtSince$Includes';

  var response = await http.get(Uri.parse(url),
      headers: {HttpHeaders.contentTypeHeader: 'application/json'});

  return response;
}