import 'package:json_annotation/json_annotation.dart'; part 'characters_dto.g.dart'; // dart run build_runner build --delete-conflicting-outputs @JsonSerializable(createToJson: false) class FCharactersDataDto { final List? items; final int? page; final int? pages; const FCharactersDataDto({this.items, this.page, this.pages}); factory FCharactersDataDto.fromJson(Map json) => _$FCharactersDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class FCharacterDto { final int? id; final String? name; final String? species; final String? image; const FCharacterDto({this.id, this.species, this.image, this.name}); factory FCharacterDto.fromJson(Map json) => _$FCharacterDtoFromJson(json); }