barrierDismissible and onWillPop
This commit is contained in:
parent
61722f5b8e
commit
9dadd76a8d
@ -59,7 +59,7 @@ class DialogManager {
|
|||||||
|
|
||||||
static void reset([result]) {
|
static void reset([result]) {
|
||||||
if (_dialogContext != null) {
|
if (_dialogContext != null) {
|
||||||
Navigator.pop(_dialogContext!,result);
|
Navigator.pop(_dialogContext!, result);
|
||||||
}
|
}
|
||||||
_dialogContext = null;
|
_dialogContext = null;
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ class DialogManager {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
DialogManager.register(context);
|
DialogManager.register(context);
|
||||||
return StatefulBuilder(
|
return StatefulBuilder(
|
||||||
builder: (_, setState) => builder(setState,DialogManager.reset));
|
builder: (_, setState) => builder(setState, DialogManager.reset));
|
||||||
});
|
});
|
||||||
DialogManager.drop();
|
DialogManager.drop();
|
||||||
return res;
|
return res;
|
||||||
|
@ -135,8 +135,12 @@ void showServer() {
|
|||||||
},
|
},
|
||||||
child: Text(translate('OK')),
|
child: Text(translate('OK')),
|
||||||
),
|
),
|
||||||
]);
|
],
|
||||||
});
|
onWillPop: () async {
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}, barrierDismissible: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
String? validate(value) {
|
String? validate(value) {
|
||||||
@ -169,18 +173,10 @@ void showAbout() {
|
|||||||
)),
|
)),
|
||||||
)),
|
)),
|
||||||
]),
|
]),
|
||||||
actions: [
|
actions: [],
|
||||||
TextButton(
|
|
||||||
style: flatButtonStyle,
|
|
||||||
onPressed: () {
|
|
||||||
close();
|
|
||||||
},
|
|
||||||
child: Text(translate('OK')),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
}, barrierDismissible: true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user