search method

Future<Search> search({
  1. String? query,
  2. int? limit,
  3. int? offset,
  4. List<String>? authors,
  5. List<String>? artists,
  6. int? year,
  7. List<String>? includedTags,
  8. TagsMode? includedTagsMode,
  9. List<String>? excludedTags,
  10. TagsMode? excludedTagsMode,
  11. List<MangaStatus>? status,
  12. List<LanguageCodes>? originalLanguage,
  13. List<LanguageCodes>? excludedOriginalLanguages,
  14. List<LanguageCodes>? availableTranslatedLanguage,
  15. List<PublicDemographic>? publicationDemographic,
  16. List<String>? ids,
  17. List<ContentRating>? contentRating,
  18. String? createdAtSince,
  19. String? updatedAtSince,
  20. List<String>? includes,
  21. String? group,
  22. Map<SearchOrders, OrderDirections>? orders,
})
inherited

Endpoint used: GET /manga

Gets manga search results takes in optional parameters to filter out content and returns the query data in a Search class instance

Implementation

Future<Search> search({
  String? query,
  int? limit,
  int? offset,
  List<String>? authors,
  List<String>? artists,
  int? year,
  List<String>? includedTags,
  TagsMode? includedTagsMode,
  List<String>? excludedTags,
  TagsMode? excludedTagsMode,
  List<MangaStatus>? status,
  List<LanguageCodes>? originalLanguage,
  List<LanguageCodes>? excludedOriginalLanguages,
  List<LanguageCodes>? availableTranslatedLanguage,
  List<PublicDemographic>? publicationDemographic,
  List<String>? ids,
  List<ContentRating>? contentRating,
  String? createdAtSince, // should be of format DD-MM-YYYY
  String? updatedAtSince, // should be of format DD-MM-YYYY
  List<String>? includes,
  String? group,
  Map<SearchOrders, OrderDirections>? orders,
}) async {
  var response = await searchResponse(
    title: query,
    limit: limit,
    offset: offset,
    authors: authors,
    artists: artists,
    year: year,
    includedTags: includedTags,
    includedTagsMode: includedTagsMode,
    excludedTags: excludedTags,
    excludedTagsMode: excludedTagsMode,
    status: status,
    originalLanguage: originalLanguage,
    excludedOriginalLanguages: excludedOriginalLanguages,
    availableTranslatedLanguage: availableTranslatedLanguage,
    publicationDemographic: publicationDemographic,
    ids: ids,
    contentRating: contentRating,
    createdAtSince: createdAtSince,
    updatedAtSince: updatedAtSince,
    includes: includes,
    group: group,
    orders: orders,
  );
  try {
    var data = Search.fromJson(jsonDecode(response.body));
    return data;
  } on Exception {
    throw MangadexServerException(jsonDecode(response.body));
  }
}