diff --git a/flutter/lib/features/import/presentation/recipe_import_tab.dart b/flutter/lib/features/import/presentation/recipe_import_tab.dart index 4a0fe03b..b47d2800 100644 --- a/flutter/lib/features/import/presentation/recipe_import_tab.dart +++ b/flutter/lib/features/import/presentation/recipe_import_tab.dart @@ -83,7 +83,7 @@ class _RecipeImportTabState extends ConsumerState { context.push('/recipes/create', extra: { 'markdown': result.markdown, 'imageUrl': result.imageUrl, - }); + }).then((_) => context.go('/recipes')); } catch (e) { if (!mounted) return; setState(() => _error = mapErrorToUserMessage(e, context)); diff --git a/flutter/lib/features/inventory/presentation/consume_inventory_screen.dart b/flutter/lib/features/inventory/presentation/consume_inventory_screen.dart index 76d31d4b..870c5b5a 100644 --- a/flutter/lib/features/inventory/presentation/consume_inventory_screen.dart +++ b/flutter/lib/features/inventory/presentation/consume_inventory_screen.dart @@ -47,7 +47,7 @@ class _ConsumeInventoryScreenState ); ref.invalidate(inventoryDetailProvider(widget.itemId)); ref.invalidate(inventoryProvider); - if (mounted) context.pop(); + if (mounted) context.go('/inventory'); } catch (e) { if (mounted) { ScaffoldMessenger.of(context) diff --git a/flutter/lib/features/inventory/presentation/inventory_screen.dart b/flutter/lib/features/inventory/presentation/inventory_screen.dart index 5451acae..560249c8 100644 --- a/flutter/lib/features/inventory/presentation/inventory_screen.dart +++ b/flutter/lib/features/inventory/presentation/inventory_screen.dart @@ -119,10 +119,21 @@ class InventoryScreen extends ConsumerWidget { Positioned( right: 16, bottom: 16, - child: FloatingActionButton.extended( - onPressed: () => context.push('/inventory/create'), - icon: const Icon(Icons.add), - label: const Text('Lägg till'), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + FloatingActionButton.extended( + onPressed: () => context.push('/inventory/create'), + icon: const Icon(Icons.add), + label: const Text('Lägg till'), + ), + const SizedBox(height: 8), + FloatingActionButton.extended( + onPressed: () => context.go('/recipes'), + icon: const Icon(Icons.restaurant_menu), + label: const Text('Recept'), + ), + ], ), ), ], diff --git a/flutter/lib/features/meal_plan/presentation/meal_plan_screen.dart b/flutter/lib/features/meal_plan/presentation/meal_plan_screen.dart index 1038cf46..51fe4a2c 100644 --- a/flutter/lib/features/meal_plan/presentation/meal_plan_screen.dart +++ b/flutter/lib/features/meal_plan/presentation/meal_plan_screen.dart @@ -129,6 +129,11 @@ class _MealPlanScreenState extends ConsumerState { onPressed: () => ref.read(mealPlanWeekOffsetProvider.notifier).reset(), child: Text(l10n.mealPlanWeekCurrent), ), + IconButton( + tooltip: 'Gå till recept', + icon: const Icon(Icons.restaurant_menu), + onPressed: () => context.go('/recipes'), + ), ], ), const SizedBox(height: 12), diff --git a/flutter/lib/features/pantry/presentation/pantry_screen.dart b/flutter/lib/features/pantry/presentation/pantry_screen.dart index 16a9df02..5be955d0 100644 --- a/flutter/lib/features/pantry/presentation/pantry_screen.dart +++ b/flutter/lib/features/pantry/presentation/pantry_screen.dart @@ -284,9 +284,19 @@ class _PantryScreenState extends ConsumerState { return ListView( padding: const EdgeInsets.all(16), children: [ - Text( - 'Produkter du alltid räknar med att ha hemma.', - style: Theme.of(context).textTheme.bodyMedium, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Produkter du alltid räknar med att ha hemma.', + style: Theme.of(context).textTheme.bodyMedium, + ), + IconButton( + tooltip: 'Gå till recept', + icon: const Icon(Icons.restaurant_menu), + onPressed: () => context.go('/recipes'), + ), + ], ), const SizedBox(height: 12), Row( diff --git a/flutter/lib/features/recipes/presentation/recipe_detail_screen.dart b/flutter/lib/features/recipes/presentation/recipe_detail_screen.dart index 0a634719..00295cd3 100644 --- a/flutter/lib/features/recipes/presentation/recipe_detail_screen.dart +++ b/flutter/lib/features/recipes/presentation/recipe_detail_screen.dart @@ -36,6 +36,11 @@ class RecipeDetailScreen extends ConsumerWidget { onPressed: () => context.push('/recipes/$recipeId/edit'), ), + IconButton( + tooltip: 'Gå till inventarie', + icon: const Icon(Icons.inventory_2_outlined), + onPressed: () => context.go('/inventory'), + ), _DeleteButton(recipe: recipeAsync.value!), ], ), @@ -46,6 +51,7 @@ class RecipeDetailScreen extends ConsumerWidget { onRetry: () => ref.invalidate(recipeDetailProvider(recipeId)), ), data: (recipe) => CustomScrollView( + physics: const BouncingScrollPhysics(), slivers: [ SliverAppBar( expandedHeight: MediaQuery.of(context).size.height * 2 / 3, diff --git a/flutter/lib/features/recipes/presentation/recipe_edit_screen.dart b/flutter/lib/features/recipes/presentation/recipe_edit_screen.dart index 27c99af9..8d5cac83 100644 --- a/flutter/lib/features/recipes/presentation/recipe_edit_screen.dart +++ b/flutter/lib/features/recipes/presentation/recipe_edit_screen.dart @@ -218,7 +218,7 @@ class _RecipeEditScreenState extends ConsumerState { ); ref.invalidate(recipeDetailProvider(widget.recipeId)); ref.invalidate(recipesProvider); - if (mounted) context.pop(); + if (mounted) context.go('/recipes/${widget.recipeId}'); } on ApiException catch (e) { if (e.type == ApiErrorType.unauthorized) { await ref.read(authStateProvider.notifier).logout();