From 6ea268bf58b1b43628ce165707d70a406c3feedf Mon Sep 17 00:00:00 2001 From: bvandeusen Date: Mon, 6 Apr 2026 18:33:04 -0400 Subject: [PATCH] fix: use dialog context in delete confirmation to prevent shell nav pop Navigator.pop(outerContext) inside a showDialog builder resolves to the ShellRoute's nested navigator instead of the root navigator where the dialog lives, popping the conversations route and showing a black screen. Co-Authored-By: Claude Sonnet 4.6 --- lib/screens/chat/conversations_tab_screen.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/screens/chat/conversations_tab_screen.dart b/lib/screens/chat/conversations_tab_screen.dart index a82cb07..6c8f271 100644 --- a/lib/screens/chat/conversations_tab_screen.dart +++ b/lib/screens/chat/conversations_tab_screen.dart @@ -99,15 +99,15 @@ class ConversationsTabScreen extends ConsumerWidget { BuildContext context, WidgetRef ref, int id, String title) async { final ok = await showDialog( context: context, - builder: (_) => AlertDialog( + builder: (dialogContext) => AlertDialog( title: const Text('Delete conversation?'), content: Text('"$title" will be permanently deleted.'), actions: [ TextButton( - onPressed: () => Navigator.pop(context, false), + onPressed: () => Navigator.pop(dialogContext, false), child: const Text('Cancel')), FilledButton( - onPressed: () => Navigator.pop(context, true), + onPressed: () => Navigator.pop(dialogContext, true), child: const Text('Delete')), ], ),