From e52ab22a31d9060a02b378487af2cc3e4b1a20eb Mon Sep 17 00:00:00 2001 From: Serxiolog Date: Mon, 18 Nov 2024 16:32:11 +0400 Subject: [PATCH] Search From 5 (1) --- lib/data/repositories/anime_repository.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/data/repositories/anime_repository.dart b/lib/data/repositories/anime_repository.dart index 3decdb0..1ddf840 100644 --- a/lib/data/repositories/anime_repository.dart +++ b/lib/data/repositories/anime_repository.dart @@ -16,12 +16,16 @@ class AnimeRepository extends ApiInterface { static const String _baseUrl = 'https://api.jikan.moe'; @override - Future?> loadData() async{ + Future?> loadData({String? q}) async{ try { const String url = '$_baseUrl/v4/anime'; - final Response response = await _dio.get>(url); - + Map query = {'limit' : 5, 'q' : q}; + final Response response = + await _dio.get>( + url, + queryParameters: query, + ); final AnimesDto dto = AnimesDto.fromJson(response.data as Map); final List? data = dto.data?.map((e) => e.toDomain()).toList(); return data;