PMU/lib/data/dtos/recipes_dto.dart
2024-12-19 11:41:08 +04:00

42 lines
947 B
Dart

import 'package:json_annotation/json_annotation.dart';
part 'recipes_dto.g.dart';
@JsonSerializable(createToJson: false)
class RecipesDto {
final List<RecipeDataDto>? hits;
const RecipesDto({this.hits});
factory RecipesDto.fromJson(Map<String, dynamic> json) =>
_$RecipesDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class RecipeDataDto {
final RecipeAttributesDataDto? recipe;
const RecipeDataDto({this.recipe});
factory RecipeDataDto.fromJson(Map<String, dynamic> json) =>
_$RecipeDataDtoFromJson(json);
}
@JsonSerializable(createToJson: false)
class RecipeAttributesDataDto {
final String? label;
final double? calories;
final String? url;
final String? image;
const RecipeAttributesDataDto({
this.label,
this.calories,
this.url,
this.image,
});
factory RecipeAttributesDataDto.fromJson(Map<String, dynamic> json) =>
_$RecipeAttributesDataDtoFromJson(json);
}