diff --git a/lib/utils/ui_utils.dart b/lib/utils/ui_utils.dart index 3e855cd..d559f28 100644 --- a/lib/utils/ui_utils.dart +++ b/lib/utils/ui_utils.dart @@ -150,8 +150,8 @@ Future showConfirmDialog({ if (title == null) title = tr("Confirm operation"); // Avoid potential theme issues - var ctx = Scaffold.of(context).context; - ctx = ctx != null ? ctx : context; + final scaffold = Scaffold.of(context, nullOk: true); + final ctx = scaffold != null ? scaffold.context : context; final result = await showDialog( context: ctx,