33 lines
1020 B
Dart
Raw Normal View History

2024-10-28 16:20:50 +04:00
import 'package:json_annotation/json_annotation.dart';
part 'car_dto.g.dart';
@JsonSerializable(createToJson: false)
class CarDto {
2024-12-11 13:10:34 +04:00
final List<CarResultDto>? result;
const CarDto({this.result});
2024-10-28 16:20:50 +04:00
factory CarDto.fromJson(Map<String, dynamic> json) => _$CarDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
2024-12-11 13:10:34 +04:00
class CarResultDto {
2024-10-28 16:20:50 +04:00
final String? id;
2024-12-11 13:10:34 +04:00
final CarAttributesResultDto? attributes;
2024-10-28 16:20:50 +04:00
2024-12-11 13:10:34 +04:00
const CarResultDto({this.id, this.attributes});
2024-10-28 16:20:50 +04:00
2024-12-11 13:10:34 +04:00
factory CarResultDto.fromJson(Map<String, dynamic> json) => _$CarResultDtoFromJson(json);
2024-10-28 16:20:50 +04:00
}
@JsonSerializable(createToJson: false)
2024-12-11 13:10:34 +04:00
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;
2024-10-28 16:20:50 +04:00
2024-12-11 13:10:34 +04:00
const CarAttributesResultDto({this.modelid, this.makename, this.modelname});
2024-10-28 16:20:50 +04:00
2024-12-11 13:10:34 +04:00
factory CarAttributesResultDto.fromJson(Map<String, dynamic> json) => _$CarAttributesResultDtoFromJson(json);
}