29 lines
833 B
Dart
29 lines
833 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'car_dto.g.dart';
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
class CarDto {
|
|
@JsonKey(name: 'Results')
|
|
final List<CarAttributesResultDto>? data;
|
|
|
|
const CarDto({this.data});
|
|
factory CarDto.fromJson(Map<String, dynamic> json) => _$CarDtoFromJson(json);
|
|
}
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
class CarAttributesResultDto {
|
|
@JsonKey(name: 'Model_ID')
|
|
final int? modelID;
|
|
@JsonKey(name: 'Make_Name')
|
|
final String? makeName;
|
|
@JsonKey(name: 'Model_Name')
|
|
final String? modelName;
|
|
|
|
const CarAttributesResultDto({this.modelID, this.makeName, this.modelName});
|
|
|
|
factory CarAttributesResultDto.fromJson(Map<String, dynamic> json) =>
|
|
_$CarAttributesResultDtoFromJson(json);
|
|
// Map<String, dynamic> toJson() => _$CarAttributesResultDtoFromJson(this);
|
|
}
|