From 0f2d86efdb80d4e5634f434cb2846de3c97330ef Mon Sep 17 00:00:00 2001 From: dbastrikin Date: Sun, 22 Feb 2026 17:29:55 +0200 Subject: [PATCH] fix: use dialog context in product delete confirmation Navigator.pop(context) with the outer tile context caused go_router to pop the main navigation stack instead of closing the dialog. Use the builder's ctx parameter instead. Co-Authored-By: Claude Sonnet 4.6 --- client/lib/features/products/products_screen.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/lib/features/products/products_screen.dart b/client/lib/features/products/products_screen.dart index 39e2107..e23c8c1 100644 --- a/client/lib/features/products/products_screen.dart +++ b/client/lib/features/products/products_screen.dart @@ -176,16 +176,16 @@ class _ProductTile extends ConsumerWidget { confirmDismiss: (_) async { return await showDialog( context: context, - builder: (_) => AlertDialog( + builder: (ctx) => AlertDialog( title: const Text('Удалить продукт?'), content: Text('«${product.name}» будет удалён из списка.'), actions: [ TextButton( - onPressed: () => Navigator.pop(context, false), + onPressed: () => Navigator.pop(ctx, false), child: const Text('Отмена'), ), TextButton( - onPressed: () => Navigator.pop(context, true), + onPressed: () => Navigator.pop(ctx, true), child: const Text('Удалить'), ), ],