import 'package:json_annotation/json_annotation.dart'; part 'characters_dto.g.dart'; @JsonSerializable(createToJson: false) class CharactersDto { final List? results; final InfoDto? info; const CharactersDto({this.results, this.info}); factory CharactersDto.fromJson(Map json) => _$CharactersDtoFromJson(json); } @JsonSerializable(createToJson: false) class CharactersDataDto { final String? id; final String? name; final String? status; final List species; final String? age; const CharactersDataDto({this.id, this.type, this.attributes}); factory CharactersDataDto.fromJson(Map json) => _$CharactersDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class InfoDto { final PaginationDto? pagination; const InfoDto({this.pagination}); factory InfoDto.fromJson(Map json) => _$MetaDtoFromJson(json); } @JsonSerializable(createToJson: false) class PaginationDto { final int? current; final int? next; final int? last; const PaginationDto({this.current, this.next, this.last}); factory PaginationDto.fromJson(Map json) => _$PaginationDtoFromJson(json); }