feat(recipe): add creating recipes

This commit is contained in:
Alex
2024-12-18 11:56:20 +03:00
parent f6d4ea7df6
commit e0ec45e19e
24 changed files with 2267 additions and 510 deletions

View File

@@ -0,0 +1,50 @@
import 'dart:io';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'recipe_create_entity.freezed.dart';
enum TypeOfRecipe {
first_meals,
second_meals,
salads,
snacks,
sweets,
drinks,
other,
}
@freezed
class RecipeCreateEntity with _$RecipeCreateEntity {
const factory RecipeCreateEntity({
String? title,
TypeOfRecipe? typeOfRecipe,
int? countOfPortions,
double? energyInOnePortion,
String? totalCookTime, // hh:mm
String? activeCookTime, // hh:mm
String? description,
File? image,
String? videoUrl,
required List<IngredientEntity> ingredients,
required List<StepEntity> steps,
required List<String> tags, // tags for search
}) = _RecipeCreateEntity;
}
@freezed
class IngredientEntity with _$IngredientEntity {
const factory IngredientEntity({
required String name,
required String unit,
required String portion,
}) = _IngredientEntity;
}
@freezed
class StepEntity with _$StepEntity {
const factory StepEntity({
String? description,
File? image,
}) = _StepEntity;
}