PMD_labs/lib/data/dtos/titans_dto.dart

24 lines
733 B
Dart
Raw Normal View History

2024-11-27 23:10:56 +04:00
import 'package:json_annotation/json_annotation.dart';
2024-12-20 14:50:19 +04:00
part 'titans_dto.g.dart';
2024-11-27 23:10:56 +04:00
@JsonSerializable(createToJson: false)
2024-12-20 14:50:19 +04:00
class TitansDto {
final List<TitansResultsDto>? results;
2024-12-20 14:49:52 +04:00
final InfoDto? info;
2024-12-20 14:50:19 +04:00
const TitansDto({this.results, this.info});
factory TitansDto.fromJson(Map<String, dynamic> json) => _$TitansDtoFromJson(json);
2024-11-27 23:10:56 +04:00
}
@JsonSerializable(createToJson: false)
2024-12-20 14:50:19 +04:00
class TitansResultsDto {
2024-11-27 23:10:56 +04:00
final String? id;
2024-12-20 14:49:52 +04:00
final String? name;
2024-12-20 14:50:19 +04:00
final String? height;
final List<String>? abilities;
final String? allegiance;
const TitansResultsDto({this.id, this.name, this.height, this.abilities, this.allegiance});
factory TitansResultsDto.fromJson(Map<String, dynamic> json) =>
2024-12-17 14:33:28 +04:00
_$CharactersDataDtoFromJson(json);
2024-11-27 23:10:56 +04:00
}