чиню поиск
This commit is contained in:
parent
2d28208440
commit
f49a119d5c
@ -24,9 +24,9 @@ class PokemonDataDto {
|
||||
final String? name;
|
||||
final String? url;
|
||||
final String? imageUrl;
|
||||
final int? height; // Добавлено поле для роста
|
||||
final int? weight; // Добавлено поле для веса
|
||||
final List<AbilityDto>? abilities; // Добавлено поле для способностей
|
||||
final int? height;
|
||||
final int? weight;
|
||||
final List<AbilityDto>? abilities;
|
||||
|
||||
const PokemonDataDto({
|
||||
this.name,
|
||||
|
@ -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<String, dynamic> queryParameters = {
|
||||
Map<String, dynamic> queryParameters = {
|
||||
'offset': page,
|
||||
'limit': pageSize,
|
||||
};
|
||||
|
||||
if (q != null && q.isNotEmpty) {
|
||||
url = '$_baseUrl/pokemon/$q';
|
||||
queryParameters = {
|
||||
'offset': page,
|
||||
'limit': pageSize,
|
||||
};
|
||||
}
|
||||
|
||||
final Response<dynamic> response = await _dio.get<Map<dynamic, dynamic>>(
|
||||
|
Loading…
Reference in New Issue
Block a user