pmu/lib/data/dtos/PlaceDTO.dart

25 lines
664 B
Dart
Raw Normal View History

2024-11-27 12:33:41 +04:00
import 'package:json_annotation/json_annotation.dart';
part 'PlaceDTO.g.dart';
@JsonSerializable(createToJson: false)
class PlacesDto {
final List<PlaceDataDto>? data;
const PlacesDto({this.data});
factory PlacesDto.fromJson(Map<String, dynamic> json) => _$PlacesDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class PlaceDataDto {
final int? id;
final String? name;
final int? yearBuilt;
final String? description;
final String? imageData;
const PlaceDataDto({this.id, this.name, this.yearBuilt, this.description, this.imageData});
factory PlaceDataDto.fromJson(Map<String, dynamic> json) => _$PlaceDataDtoFromJson(json);
}