Files
eatvio_app/lib/features/recipes/entities/recipe_create_entity.dart
2024-12-18 11:56:20 +03:00

51 lines
1.1 KiB
Dart

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;
}