feat: enhance navigation by adding recipe links in inventory and pantry screens

This commit is contained in:
Nils-Johan Gynther
2026-04-24 14:13:26 +02:00
parent a39640d4ea
commit 13a0ab3584
7 changed files with 42 additions and 10 deletions
@@ -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,
@@ -218,7 +218,7 @@ class _RecipeEditScreenState extends ConsumerState<RecipeEditScreen> {
);
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();