59 lines
1.5 KiB
Dart
59 lines
1.5 KiB
Dart
import 'dart:ffi';
|
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'characters_dto.g.dart';
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
class CharactersDto {
|
|
final List<CharacterDataDto>? data;
|
|
final MetaDto? meta;
|
|
|
|
const CharactersDto({this.data, this.meta});
|
|
|
|
factory CharactersDto.fromJson(Map<String, dynamic> json) => _$CharactersDtoFromJson(json);
|
|
}
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
class CharacterDataDto {
|
|
final String? model;
|
|
final CharacterImagesDataDto? images;
|
|
final int? price;
|
|
final double? speed;
|
|
final String id;
|
|
|
|
const CharacterDataDto({this.model, this.images, this.price, this.speed, required this.id});
|
|
|
|
factory CharacterDataDto.fromJson(Map<String, dynamic> json) => _$CharacterDataDtoFromJson(json);
|
|
}
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
class CharacterImagesDataDto {
|
|
final String? frontQuarter;
|
|
|
|
const CharacterImagesDataDto({this.frontQuarter});
|
|
|
|
factory CharacterImagesDataDto.fromJson(Map<String, dynamic> json) =>
|
|
_$CharacterImagesDataDtoFromJson(json);
|
|
}
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
class MetaDto {
|
|
final PaginationDto? pagination;
|
|
|
|
const MetaDto({this.pagination});
|
|
|
|
factory MetaDto.fromJson(Map<String, dynamic> json) => _$MetaDtoFromJson(json);
|
|
}
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
class PaginationDto {
|
|
final int? current;
|
|
final int? next;
|
|
final int? last;
|
|
|
|
const PaginationDto({this.current, this.last, this.next});
|
|
|
|
factory PaginationDto.fromJson(Map<String, dynamic> json) => _$PaginationDtoFromJson(json);
|
|
}
|