mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-06 06:21:26 +03:00
refactor alertDialog
This commit is contained in:
@@ -41,7 +41,11 @@ class FfiModel with ChangeNotifier {
|
||||
_decoding = false;
|
||||
}
|
||||
|
||||
void update(String id, BuildContext context) {
|
||||
void update(
|
||||
String id,
|
||||
BuildContext context,
|
||||
void Function(Map<String, dynamic> evt, String id, BuildContext context)
|
||||
handleMsgbox) {
|
||||
for (;;) {
|
||||
var evt = FFI.popEvent();
|
||||
if (evt == null) break;
|
||||
@@ -82,19 +86,6 @@ class FfiModel with ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
void handleMsgbox(Map<String, dynamic> evt, String id, BuildContext context) {
|
||||
var type = evt['type'];
|
||||
var title = evt['title'];
|
||||
var text = evt['text'];
|
||||
if (type == 're-input-password') {
|
||||
wrongPasswordDialog(id, context);
|
||||
} else if (type == 'input-password') {
|
||||
enterPasswordDialog(id, context);
|
||||
} else {
|
||||
msgbox(type, title, text, context);
|
||||
}
|
||||
}
|
||||
|
||||
void handleSwitchDisplay(Map<String, dynamic> evt) {
|
||||
_pi.currentDisplay = int.parse(evt['display']);
|
||||
_display.x = double.parse(evt['x']);
|
||||
|
||||
Reference in New Issue
Block a user