31 lines
1012 B
Dart
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);
|
|
} |