feat(import): enhance recipe creation by passing both markdown and image URL from import

This commit is contained in:
Nils-Johan Gynther
2026-04-22 21:38:05 +02:00
parent 856efcfa79
commit 29beb3a85f
3 changed files with 29 additions and 5 deletions
@@ -14,7 +14,14 @@ class CreateRecipeScreen extends ConsumerStatefulWidget {
/// Optional markdown to pre-fill the input field, e.g. from import.
final String? initialMarkdown;
const CreateRecipeScreen({super.key, this.initialMarkdown});
/// Optional image URL pre-filled from a quick-import result.
final String? initialImageUrl;
const CreateRecipeScreen({
super.key,
this.initialMarkdown,
this.initialImageUrl,
});
@override
ConsumerState<CreateRecipeScreen> createState() =>
@@ -143,6 +150,8 @@ class _CreateRecipeScreenState extends ConsumerState<CreateRecipeScreen> {
if (servingsRaw != null) 'servings': servingsRaw,
if (_parsed!.instructions != null)
'instructions': _parsed!.instructions,
if (widget.initialImageUrl != null && widget.initialImageUrl!.isNotEmpty)
'imageUrl': widget.initialImageUrl,
'ingredients': ingredients,
},
token: token,