// GENERATED CODE - DO NOT MODIFY BY HAND part of 'games_dto.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** GamesDto _$GamesDtoFromJson(Map json) => GamesDto( data: (json['results'] as List?) ?.map((e) => GameDto.fromJson(e as Map)) .toList(), current: getNextPageNumber(json['next']) != null ? getNextPageNumber(json['next'])! - 1 : null, next: getNextPageNumber(json['next']), ); int? getNextPageNumber(String url) { RegExp regExp = RegExp(r'page=(\d+)'); Match? match = regExp.firstMatch(url); String? number; if (match != null) { return int.parse(match.group(1)!); } //по умолчанию след. = 2, т.е. тек. = 1 else { return null; } } GameDto _$GameDtoFromJson(Map json) => GameDto( (json['id'] as num?)?.toInt(), json['name'] as String?, json['description'] as String?, json['background_image'] as String?, json['released'] as String?, );