PIbd-31_Belianin_N._N._PMD/lib/data/dtos/houses_dto.dart
nikbel2004@outlook.com 1430fe1986 laboratory_5
2024-09-20 16:16:06 +04:00

38 lines
998 B
Dart

import 'package:json_annotation/json_annotation.dart';
// dart run build_runner build --delete-conflicting-outputs
part 'house_dto_json.dart';
@JsonSerializable(createToJson: false)
class HousesDto {
final List<HouseDataDto>? data;
const HousesDto({this.data});
factory HousesDto.fromJson(Map<String, dynamic> json) => _$HousesDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class HouseDataDto {
final String? id;
final HouseAttributesDataDto? attributes;
const HouseDataDto(this.id, this.attributes);
factory HouseDataDto.fromJson(Map<String, dynamic> json) => _$HouseDataDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class HouseAttributesDataDto {
final String? name;
final String? location;
final String? image;
final String? description;
HouseAttributesDataDto(this.name, this.location, this.image, this.description);
factory HouseAttributesDataDto.fromJson(Map<String, dynamic> json) => _$HouseAttributesDataDtoFromJson(json);
}