import 'package:json_annotation/json_annotation.dart'; part 'car_dto.g.dart'; @JsonSerializable(createToJson: false) class CarDto { @JsonKey(name: 'Count') final int? count; @JsonKey(name: 'Message') final String? message; @JsonKey(name: 'SearchCriteria') final String? searchCriteria; @JsonKey(name: 'Results') final List? results; const CarDto({this.count, this.message, this.searchCriteria, this.results}); factory CarDto.fromJson(Map 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 json) => _$CarAttributesResultDtoFromJson(json); // Map toJson() => _$CarAttributesResultDtoFromJson(this); }