Files

55 lines
1.5 KiB
Dart
Raw Permalink Normal View History

import 'dart:io';
import 'package:cookit/src/recipes/models/recipe.dart';
import 'package:cookit/src/recipes/photo_store.dart';
final testTime = DateTime.utc(2026, 10, 20, 12);
Recipe recipe({
String id = 'r1',
String name = 'Focaccia',
String? courseId,
List<String> tags = const [],
List<IngredientGroup>? ingredientGroups,
List<StepSection>? stepSections,
List<String> photos = const [],
bool favourite = false,
List<String> reviewReasons = const [],
}) => Recipe(
id: id,
name: name,
courseId: courseId,
tags: tags,
servings: 4,
prepMinutes: 30,
cookMinutes: 20,
calories: const Calories(775, CaloriesBasis.perServing),
ingredientGroups:
ingredientGroups ??
const [
IngredientGroup(
lines: [
IngredientLine(amount: 300, unitKey: 'gram', name: 'Mehl'),
IngredientLine(amount: 2, amountMax: 3, unitKey: 'tablespoon', name: 'Olivenöl', remark: 'gutes'),
],
),
IngredientGroup(
name: 'Topping',
lines: [IngredientLine(name: 'Rosmarin')],
),
],
stepSections:
stepSections ??
const [
StepSection(title: 'Teig', steps: ['Kneten.', 'Gehen lassen.']),
],
photos: photos,
sources: const ['https://example.org/focaccia'],
notes: '22x22 cm Form',
favourite: favourite,
reviewReasons: reviewReasons,
createdAt: testTime,
updatedAt: testTime,
);
Future<PhotoStore> tempPhotoStore() async => PhotoStore(await Directory.systemTemp.createTemp('cookit_photos_'));