diff --git a/lib/ui/widgets/tablet_mode/memberships_panel.dart b/lib/ui/widgets/tablet_mode/memberships_panel.dart index 010b9fc..e3f2ed8 100644 --- a/lib/ui/widgets/tablet_mode/memberships_panel.dart +++ b/lib/ui/widgets/tablet_mode/memberships_panel.dart @@ -171,8 +171,7 @@ class _MembershipsPanelState extends SafeState { try { if (!accept && !await showConfirmDialog( - context: Scaffold.of(context) - .context, // Without this the text appears in white + context: context, message: tr("Do you really want to reject this friendship request?"))) return; diff --git a/lib/utils/ui_utils.dart b/lib/utils/ui_utils.dart index dc528f3..3fca695 100644 --- a/lib/utils/ui_utils.dart +++ b/lib/utils/ui_utils.dart @@ -146,8 +146,12 @@ Future showConfirmDialog({ }) async { if (title == null) title = tr("Confirm operation"); + // Avoid potential theme issues + var ctx = Scaffold.of(context).context; + ctx = ctx!= null ? ctx : context; + final result = await showDialog( - context: context, + context: ctx, builder: (c) => AlertDialog( title: Text(title), content: Text(message),