From f49a119d5c98dfe0b929a2b467e7784827f680d0 Mon Sep 17 00:00:00 2001 From: ohwhylin Date: Mon, 18 Nov 2024 15:05:17 +0400 Subject: [PATCH] =?UTF-8?q?=D1=87=D0=B8=D0=BD=D1=8E=20=D0=BF=D0=BE=D0=B8?= =?UTF-8?q?=D1=81=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/data/dtos/pokemon_dto.dart | 6 +++--- lib/data/repositories/pokemon_repository.dart | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/data/dtos/pokemon_dto.dart b/lib/data/dtos/pokemon_dto.dart index b4faac2..8b58d94 100644 --- a/lib/data/dtos/pokemon_dto.dart +++ b/lib/data/dtos/pokemon_dto.dart @@ -24,9 +24,9 @@ class PokemonDataDto { final String? name; final String? url; final String? imageUrl; - final int? height; // Добавлено поле для роста - final int? weight; // Добавлено поле для веса - final List? abilities; // Добавлено поле для способностей + final int? height; + final int? weight; + final List? abilities; const PokemonDataDto({ this.name, diff --git a/lib/data/repositories/pokemon_repository.dart b/lib/data/repositories/pokemon_repository.dart index 527c90b..0d1b912 100644 --- a/lib/data/repositories/pokemon_repository.dart +++ b/lib/data/repositories/pokemon_repository.dart @@ -19,18 +19,22 @@ class PokeRepository extends ApiInterface { OnErrorCallback? onError, String? q, int page = 0, - int pageSize = 10, + int pageSize = 5, }) async { try { String url = '$_baseUrl/pokemon'; - final Map queryParameters = { + Map queryParameters = { 'offset': page, 'limit': pageSize, }; if (q != null && q.isNotEmpty) { url = '$_baseUrl/pokemon/$q'; + queryParameters = { + 'offset': page, + 'limit': pageSize, + }; } final Response response = await _dio.get>(