search method
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,
- String? updatedAtSince,
- List<
String> ? includes, - String? group,
- 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));
}
}