import 'package:json_annotation/json_annotation.dart'; part 'characters_dto.g.dart'; @JsonSerializable(createToJson: false) class CharactersDto { final List? array; const CharactersDto ({this.array}); factory CharactersDto.fromJson(List json) => _$CharactersDtoFromJson(json); } @JsonSerializable(createToJson: false) class CharactersDataDto { final int? id; final String? fullName; final String? title; final String? family; final String? imageUrl; const CharactersDataDto(this.id, this.fullName, this.title, this.family, this.imageUrl); factory CharactersDataDto.fromJson(Map json) => _$CharactersDataDtoFromJson(json); }