import 'package:json_annotation/json_annotation.dart'; // dart run build_runner build --delete-conflicting-outputs part 'characters_dto.g.dart'; @JsonSerializable(createToJson: false) class CharacterDataDto { final String? title; final double? price; @JsonKey(name: "image") final String? imageUrl; const CharacterDataDto(this.title, this.price, this.imageUrl); factory CharacterDataDto.fromJson(Map json) => _$CharacterDataDtoFromJson(json); }