diff --git a/lib/models/web_model.dart b/lib/models/web_model.dart index 3d651ed1b..8bf3b588a 100644 --- a/lib/models/web_model.dart +++ b/lib/models/web_model.dart @@ -83,7 +83,7 @@ class PlatformFFI { static void setMethodCallHandler(FMethod callback) {} - static Future invokeMethod(String method) async { + static Future invokeMethod(String method, [ dynamic arguments]) async { return true; } } diff --git a/lib/pages/chat_page.dart b/lib/pages/chat_page.dart index a95799df6..74a9e3ff3 100644 --- a/lib/pages/chat_page.dart +++ b/lib/pages/chat_page.dart @@ -22,7 +22,7 @@ class ChatPage extends StatelessWidget implements PageShape { @override final appBarActions = [ PopupMenuButton( - icon: Icon(Icons.list_alt), + icon: Icon(Icons.more_vert), itemBuilder: (context) { final chatModel = FFI.chatModel; final serverModel = FFI.serverModel; @@ -176,8 +176,7 @@ class _ChatWindowOverlayState extends State { }); } - checkScreenSize() { - } + checkScreenSize() {} checkKeyboard() { final bottomHeight = MediaQuery.of(context).viewInsets.bottom; diff --git a/lib/pages/connection_page.dart b/lib/pages/connection_page.dart index c092b7d04..5252d2b1b 100644 --- a/lib/pages/connection_page.dart +++ b/lib/pages/connection_page.dart @@ -286,37 +286,40 @@ class _WebMenuState extends State { Widget build(BuildContext context) { Provider.of(context); final username = getUsername(); - return PopupMenuButton(itemBuilder: (context) { - return [ - PopupMenuItem( - child: Text(translate('ID/Relay Server')), - value: "server", - ), - PopupMenuItem( - child: Text(username == null - ? translate("Login") - : translate("Logout") + ' ($username)'), - value: "login", - ), - PopupMenuItem( - child: Text(translate('About') + ' RustDesk'), - value: "about", - ) - ]; - }, onSelected: (value) { - if (value == 'server') { - showServer(); - } - if (value == 'about') { - showAbout(); - } - if (value == 'login') { - if (username == null) { - showLogin(); - } else { - logout(); - } - } - }); + return PopupMenuButton( + icon: Icon(Icons.more_vert), + itemBuilder: (context) { + return [ + PopupMenuItem( + child: Text(translate('ID/Relay Server')), + value: "server", + ), + PopupMenuItem( + child: Text(username == null + ? translate("Login") + : translate("Logout") + ' ($username)'), + value: "login", + ), + PopupMenuItem( + child: Text(translate('About') + ' RustDesk'), + value: "about", + ) + ]; + }, + onSelected: (value) { + if (value == 'server') { + showServer(); + } + if (value == 'about') { + showAbout(); + } + if (value == 'login') { + if (username == null) { + showLogin(); + } else { + logout(); + } + } + }); } } diff --git a/lib/pages/server_page.dart b/lib/pages/server_page.dart index e716f5d31..a607ec837 100644 --- a/lib/pages/server_page.dart +++ b/lib/pages/server_page.dart @@ -17,41 +17,44 @@ class ServerPage extends StatelessWidget implements PageShape { @override final appBarActions = [ - PopupMenuButton(itemBuilder: (context) { - return [ - PopupMenuItem( - child: Text(translate("Change ID")), - value: "changeID", - enabled: false, - ), - PopupMenuItem( - child: Text(translate("Set your own password")), - value: "changePW", - enabled: FFI.serverModel.isStart, - ), - PopupMenuItem( - child: Text(translate("Refresh random password")), - value: "refreshPW", - enabled: FFI.serverModel.isStart, - ) - ]; - }, onSelected: (value) { - if (value == "changeID") { - // TODO - } else if (value == "changePW") { - updatePasswordDialog(); - } else if (value == "refreshPW") { - () async { - showLoading(translate("Waiting")); - if(await FFI.serverModel.updatePassword("")){ - showSuccess(); - }else{ - showError(); + PopupMenuButton( + icon: Icon(Icons.more_vert), + itemBuilder: (context) { + return [ + PopupMenuItem( + child: Text(translate("Change ID")), + value: "changeID", + enabled: false, + ), + PopupMenuItem( + child: Text(translate("Set your own password")), + value: "changePW", + enabled: FFI.serverModel.isStart, + ), + PopupMenuItem( + child: Text(translate("Refresh random password")), + value: "refreshPW", + enabled: FFI.serverModel.isStart, + ) + ]; + }, + onSelected: (value) { + if (value == "changeID") { + // TODO + } else if (value == "changePW") { + updatePasswordDialog(); + } else if (value == "refreshPW") { + () async { + showLoading(translate("Waiting")); + if (await FFI.serverModel.updatePassword("")) { + showSuccess(); + } else { + showError(); + } + debugPrint("end updatePassword"); + }(); } - debugPrint("end updatePassword"); - }(); - } - }) + }) ]; @override