diff --git a/lib/widgets/responsive_dialog.dart b/lib/widgets/responsive_dialog.dart index a6ea00f0..226bc36c 100755 --- a/lib/widgets/responsive_dialog.dart +++ b/lib/widgets/responsive_dialog.dart @@ -76,6 +76,7 @@ class _ResponsiveDialogState extends State { ? l10n.s_close : l10n.s_cancel; return PopScope( + canPop: widget.allowCancel, child: AlertDialog( title: widget.title, titlePadding: const EdgeInsets.only(top: 24, left: 18, right: 18), @@ -87,10 +88,12 @@ class _ResponsiveDialogState extends State { ), actions: [ TextButton( + onPressed: widget.allowCancel + ? () { + Navigator.of(context).pop(); + } + : null, child: Text(cancelText), - onPressed: () { - Navigator.of(context).pop(); - }, ), ...widget.actions ],