33 lines
1020 B
Dart
33 lines
1020 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'car_dto.g.dart';
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
class CarDto {
|
|
final List<CarResultDto>? result;
|
|
const CarDto({this.result});
|
|
factory CarDto.fromJson(Map<String, dynamic> json) => _$CarDtoFromJson(json);
|
|
}
|
|
@JsonSerializable(createToJson: false)
|
|
class CarResultDto {
|
|
final String? id;
|
|
final CarAttributesResultDto? attributes;
|
|
|
|
const CarResultDto({this.id, this.attributes});
|
|
|
|
factory CarResultDto.fromJson(Map<String, dynamic> json) => _$CarResultDtoFromJson(json);
|
|
}
|
|
@JsonSerializable(createToJson: false)
|
|
class CarAttributesResultDto {
|
|
@JsonKey(name: 'Model_ID')
|
|
final String? modelid;
|
|
@JsonKey(name: 'Make_Name')
|
|
final String? makename; // Поле для make_and_model
|
|
@JsonKey(name: 'Model_Name')
|
|
final String? modelname;
|
|
|
|
const CarAttributesResultDto({this.modelid, this.makename, this.modelname});
|
|
|
|
factory CarAttributesResultDto.fromJson(Map<String, dynamic> json) => _$CarAttributesResultDtoFromJson(json);
|
|
}
|