fix: use dialog context in event delete confirmation

Same navigator mismatch as the chat delete bug — outer context inside
showDialog builder resolves to the wrong navigator ancestor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 18:35:41 -04:00
parent 6ea268bf58
commit 946b70ecc4
+5 -5
View File
@@ -143,19 +143,19 @@ class _EventFormSheetState extends ConsumerState<EventFormSheet> {
Future<void> _delete() async {
final confirmed = await showDialog<bool>(
context: context,
builder: (_) => AlertDialog(
builder: (dialogContext) => AlertDialog(
title: const Text('Delete this event?'),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(false),
onPressed: () => Navigator.pop(dialogContext, false),
child: const Text('Cancel'),
),
TextButton(
onPressed: () => Navigator.of(context).pop(true),
onPressed: () => Navigator.pop(dialogContext, true),
child: Text(
'Delete',
style:
TextStyle(color: Theme.of(context).colorScheme.error),
style: TextStyle(
color: Theme.of(dialogContext).colorScheme.error),
),
),
],