mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-12 10:56:11 +02:00
flutter_desktop: handle privacy mode back notifications
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
e553756ad8
commit
b2ffe9dee4
8 changed files with 210 additions and 38 deletions
|
@ -194,14 +194,20 @@ void msgBox(String type, String title, String text, {bool? hasCancel}) {
|
|||
style: TextStyle(color: MyTheme.accent))));
|
||||
|
||||
SmartDialog.dismiss();
|
||||
final buttons = [
|
||||
wrap(Translator.call('OK'), () {
|
||||
SmartDialog.dismiss();
|
||||
backToHome();
|
||||
})
|
||||
];
|
||||
List<Widget> buttons = [];
|
||||
if (type != "connecting" && type != "success" && type.indexOf("nook") < 0) {
|
||||
buttons.insert(
|
||||
0,
|
||||
wrap(Translator.call('OK'), () {
|
||||
SmartDialog.dismiss();
|
||||
backToHome();
|
||||
}));
|
||||
}
|
||||
if (hasCancel == null) {
|
||||
hasCancel = type != 'error';
|
||||
// hasCancel = type != 'error';
|
||||
hasCancel = type.indexOf("error") < 0 &&
|
||||
type.indexOf("nocancel") < 0 &&
|
||||
type != "restarting";
|
||||
}
|
||||
if (hasCancel) {
|
||||
buttons.insert(
|
||||
|
@ -210,6 +216,14 @@ void msgBox(String type, String title, String text, {bool? hasCancel}) {
|
|||
SmartDialog.dismiss();
|
||||
}));
|
||||
}
|
||||
// TODO: test this button
|
||||
if (type.indexOf("hasclose") >= 0) {
|
||||
buttons.insert(
|
||||
0,
|
||||
wrap(Translator.call('Close'), () {
|
||||
SmartDialog.dismiss();
|
||||
}));
|
||||
}
|
||||
DialogManager.show((setState, close) => CustomAlertDialog(
|
||||
title: Text(translate(title), style: TextStyle(fontSize: 21)),
|
||||
content: Text(Translator.call(text), style: TextStyle(fontSize: 15)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue