PMD_labs/lib/data/dtos/characters_dto.dart
2024-11-27 23:10:56 +04:00

31 lines
1012 B
Dart

import 'package:json_annotation/json_annotation.dart';
part 'characters_dto.g.dart';
@JsonSerializable(createToJson: false)
class CharactersDto{
final List<CharactersDataDto>? data;
const CharactersDto({this.data});
factory CharactersDto.fromJson(Map<String, dynamic> 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<String, dynamic> 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<String, dynamic> json) => _$CharasterAttributesDataDtoFromJson(json);
}