import 'package:json_annotation/json_annotation.dart'; part 'character_dto.g.dart'; @JsonSerializable(createToJson: false) class CharactersDto { @JsonKey(name: 'characters') 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 int? id; final String? name; final List? images; @JsonKey(name: 'personal') final CharacterDataAttributesDto? attributes; const CharacterDataDto({this.id, this.name, this.images, this.attributes}); factory CharacterDataDto.fromJson(Map json) => _$CharacterDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class CharacterDataAttributesDto { final String? birthdate; final String? sex; final String? clan; const CharacterDataAttributesDto({this.birthdate, this.sex, this.clan}); factory CharacterDataAttributesDto.fromJson(Map json) => _$CharacterDataAttributesDtoFromJson(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); }