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 16:09:01 +04:00
const TitansDto({this.results});
2024-12-20 14:50:19 +04:00
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;
2024-12-20 16:09:01 +04:00
final String? image;
const TitansResultsDto({this.id, this.name, this.height, this.abilities, this.allegiance, this.image});
2024-12-20 14:50:19 +04:00
factory TitansResultsDto.fromJson(Map<String, dynamic> json) =>
2024-12-20 16:09:01 +04:00
_$TitansResultsDtoFromJson(json);
2024-11-27 23:10:56 +04:00
}