mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 10:11:52 +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_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<ResponsiveDialog> {
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text(cancelText),
|
||||
onPressed: () {
|
||||
onPressed: widget.allowCancel
|
||||
? () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
}
|
||||
: null,
|
||||
child: Text(cancelText),
|
||||
),
|
||||
...widget.actions
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user