29 lines
828 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';
2024-12-11 17:49:42 +04:00
2024-10-28 16:20:50 +04:00
@JsonSerializable(createToJson: false)
class CarDto {
2024-12-11 17:49:42 +04:00
@JsonKey(name: 'Results')
2024-12-17 10:07:39 +04:00
final List<CarAttributesResultDto>? data;
2024-10-28 16:20:50 +04:00
2024-12-17 10:07:39 +04:00
const CarDto({this.data});
2024-12-11 17:49:42 +04:00
factory CarDto.fromJson(Map<String, dynamic> json) => _$CarDtoFromJson(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')
2024-12-11 17:49:42 +04:00
final int? modelID;
2024-12-11 13:10:34 +04:00
@JsonKey(name: 'Make_Name')
2024-12-11 17:49:42 +04:00
final String? makeName;
2024-12-11 13:10:34 +04:00
@JsonKey(name: 'Model_Name')
2024-12-11 17:49:42 +04:00
final String? modelName;
2024-10-28 16:20:50 +04:00
2024-12-11 17:49:42 +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);
2024-12-11 17:49:42 +04:00
// Map<String, dynamic> toJson() => _$CarAttributesResultDtoFromJson(this);
2024-12-11 13:10:34 +04:00
}
2024-12-11 17:49:42 +04:00