MDP_Yashin/lib/data/dtos/characters_dto.dart

23 lines
693 B
Dart
Raw Normal View History

2024-11-13 14:55:40 +04:00
import 'package:json_annotation/json_annotation.dart';
part 'characters_dto.g.dart';
@JsonSerializable(createToJson: false)
class CharactersDto {
final List<CharactersDataDto>? array;
const CharactersDto ({this.array});
factory CharactersDto.fromJson(List<dynamic> 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<String, dynamic> json) => _$CharactersDataDtoFromJson(json);
}