PIbd-33_Dyakonov_R_R_PMD/lib/data/dtos/characters_dto.dart

30 lines
791 B
Dart
Raw Normal View History

2024-09-15 21:41:47 +04:00
import 'package:json_annotation/json_annotation.dart';
part 'characters_dto.g.dart';
2024-09-25 14:35:14 +04:00
// dart run build_runner build --delete-conflicting-outputs
@JsonSerializable(createToJson: false)
2024-12-08 19:17:00 +04:00
class FCharactersDataDto {
final List<FCharacterDto>? items;
final int? page;
final int? pages;
2024-09-25 14:35:14 +04:00
2024-12-08 19:17:00 +04:00
const FCharactersDataDto({this.items, this.page, this.pages});
2024-09-25 14:35:14 +04:00
2024-12-08 19:17:00 +04:00
factory FCharactersDataDto.fromJson(Map<String, dynamic> json) =>
_$FCharactersDataDtoFromJson(json);
2024-09-17 00:03:15 +04:00
}
2024-09-15 21:41:47 +04:00
@JsonSerializable(createToJson: false)
2024-12-08 19:17:00 +04:00
class FCharacterDto {
final int? id;
2024-09-17 00:03:15 +04:00
final String? name;
final String? species;
2024-12-08 19:17:00 +04:00
final String? image;
2024-09-17 00:03:15 +04:00
2024-12-08 19:17:00 +04:00
const FCharacterDto({this.id, this.species, this.image, this.name});
2024-09-17 00:03:15 +04:00
2024-12-08 19:17:00 +04:00
factory FCharacterDto.fromJson(Map<String, dynamic> json) =>
_$FCharacterDtoFromJson(json);
2024-09-25 14:35:14 +04:00
}