PIbd-33_Dyakonov_R_R_PMD/lib/data/dtos/characters_dto.dart
2024-12-08 19:17:00 +04:00

30 lines
791 B
Dart

import 'package:json_annotation/json_annotation.dart';
part 'characters_dto.g.dart';
// dart run build_runner build --delete-conflicting-outputs
@JsonSerializable(createToJson: false)
class FCharactersDataDto {
final List<FCharacterDto>? items;
final int? page;
final int? pages;
const FCharactersDataDto({this.items, this.page, this.pages});
factory FCharactersDataDto.fromJson(Map<String, dynamic> json) =>
_$FCharactersDataDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class FCharacterDto {
final int? id;
final String? name;
final String? species;
final String? image;
const FCharacterDto({this.id, this.species, this.image, this.name});
factory FCharacterDto.fromJson(Map<String, dynamic> json) =>
_$FCharacterDtoFromJson(json);
}