feat(import): implement recipe import functionality with file and URL support
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import '../../features/inventory/presentation/consume_inventory_screen.dart';
|
||||
import '../../features/inventory/presentation/consumption_history_screen.dart';
|
||||
import '../../features/meal_plan/presentation/meal_plan_screen.dart';
|
||||
import '../../features/pantry/presentation/pantry_screen.dart';
|
||||
import '../../features/import/presentation/import_screen.dart';
|
||||
|
||||
final appRouterProvider = Provider<GoRouter>((ref) {
|
||||
final authState = ref.watch(authStateProvider);
|
||||
@@ -66,7 +67,10 @@ final appRouterProvider = Provider<GoRouter>((ref) {
|
||||
// /recipes/create must be listed before /recipes/:id to avoid conflict.
|
||||
GoRoute(
|
||||
path: '/recipes/create',
|
||||
builder: (context, state) => const CreateRecipeScreen(),
|
||||
builder: (context, state) {
|
||||
final initialMarkdown = state.extra as String?;
|
||||
return CreateRecipeScreen(initialMarkdown: initialMarkdown);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: '/recipes/:id',
|
||||
@@ -168,6 +172,10 @@ final appRouterProvider = Provider<GoRouter>((ref) {
|
||||
path: '/baslager',
|
||||
builder: (context, state) => const PantryScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/import',
|
||||
builder: (context, state) => const ImportScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/profile',
|
||||
builder: (context, state) => const ProfileScreen(),
|
||||
|
||||
@@ -39,6 +39,12 @@ class AppShell extends ConsumerWidget {
|
||||
icon: Icons.storefront_outlined,
|
||||
label: 'Baslager',
|
||||
),
|
||||
_AppDestination(
|
||||
path: '/import',
|
||||
title: 'Importera',
|
||||
icon: Icons.upload_file_outlined,
|
||||
label: 'Importera',
|
||||
),
|
||||
_AppDestination(
|
||||
path: '/profile',
|
||||
title: 'Profil',
|
||||
|
||||
Reference in New Issue
Block a user