forked from eatvio/eatvio_app
feat(recipe): add creating recipes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user