23 lines
693 B
Dart
23 lines
693 B
Dart
|
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);
|
||
|
}
|