import 'package:json_annotation/json_annotation.dart'; part 'characters_dto.g.dart'; @JsonSerializable(createToJson: false) class CharactersDto{ final List? data; const CharactersDto({this.data}); factory CharactersDto.fromJson(Map json) => _$CharactersDtoFromJson(json); } @JsonSerializable(createToJson: false) class CharactersDataDto{ final String? id; final String? type; final CharasterAttributesDataDto? attributes; const CharactersDataDto({this.id, this.type, this.attributes}); factory CharactersDataDto.fromJson(Map json) => _$CharactersDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class CharasterAttributesDataDto{ final String? name; final String? born; final String? died; final String? image; const CharasterAttributesDataDto({this.name, this.born, this.died, this.image}); factory CharasterAttributesDataDto.fromJson(Map json) => _$CharasterAttributesDataDtoFromJson(json); }