feat(recipe): edit recipe

This commit is contained in:
mso7nueh
2025-05-19 15:40:00 +03:00
parent 2a1c1dc56d
commit b2b2253f06
18 changed files with 328 additions and 147 deletions

View File

@@ -25,14 +25,23 @@ class Recipe with _$Recipe {
@JsonKey(name: 'was_liked_by_me') required bool wasLikedByMe,
@JsonKey(name: 'is_favorite') required bool isFavorite,
@JsonKey(name: 'energy_per_serving') required double calories,
int? servings,
@JsonKey(name: 'total_likes') required int likesCount,
@JsonKey(name: 'total_views') required int viewsCount,
required List<Tag> tags,
required Author author,
}) = _Recipes;
factory Recipe.fromJson(Map<String, Object?> json) => _$RecipeFromJson(json);
}
@freezed
class Tag with _$Tag {
const factory Tag({required String name}) = _Tag;
factory Tag.fromJson(Map<String, Object?> json) => _$TagFromJson(json);
}
@freezed
class Ingredient with _$Ingredient {
const factory Ingredient({required String name, String? unit, required String portion}) = _Ingredient;