30 lines
791 B
Dart
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);
|
|
}
|