mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 18:22:39 +03:00
Respect allowCancel in dialog mode
This commit is contained in:
parent
0e91d1c2f8
commit
688211ddf6
@ -76,6 +76,7 @@ class _ResponsiveDialogState extends State<ResponsiveDialog> {
|
|||||||
? l10n.s_close
|
? l10n.s_close
|
||||||
: l10n.s_cancel;
|
: l10n.s_cancel;
|
||||||
return PopScope(
|
return PopScope(
|
||||||
|
canPop: widget.allowCancel,
|
||||||
child: AlertDialog(
|
child: AlertDialog(
|
||||||
title: widget.title,
|
title: widget.title,
|
||||||
titlePadding: const EdgeInsets.only(top: 24, left: 18, right: 18),
|
titlePadding: const EdgeInsets.only(top: 24, left: 18, right: 18),
|
||||||
@ -87,10 +88,12 @@ class _ResponsiveDialogState extends State<ResponsiveDialog> {
|
|||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
|
onPressed: widget.allowCancel
|
||||||
|
? () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}
|
||||||
|
: null,
|
||||||
child: Text(cancelText),
|
child: Text(cancelText),
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
...widget.actions
|
...widget.actions
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user