import 'package:json_annotation/json_annotation.dart'; part 'characters_dto.g.dart'; @JsonSerializable(createToJson: false) class CharactersDto { final List? data; final MetaDto? meta; const CharactersDto({ this.data, this.meta, }); factory CharactersDto.fromJson(Map json) => _$CharactersDtoFromJson(json); } @JsonSerializable(createToJson: false) class CharacterDataDto { final String? id; final String? type; final CharacterAttributesDataDto? attributes; const CharacterDataDto({this.id, this.type, this.attributes}); factory CharacterDataDto.fromJson(Map json) => _$CharacterDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class CharacterAttributesDataDto { final String? name; final String? nationality; final String? species; final String? image; const CharacterAttributesDataDto({this.name, this.nationality, this.species, this.image}); factory CharacterAttributesDataDto.fromJson(Map json) => _$CharacterAttributesDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class MetaDto { final PaginationDto? pagination; const MetaDto({this.pagination}); factory MetaDto.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); }