From 8738e5643d2950987de9164b92bcdbb48d24a94a Mon Sep 17 00:00:00 2001 From: wanghongenpin Date: Tue, 12 Nov 2024 09:29:15 +0800 Subject: [PATCH] fix script url query convert --- lib/network/util/uri.dart | 2 +- lib/ui/desktop/toolbar/setting/request_rewrite.dart | 2 +- lib/ui/desktop/toolbar/setting/script.dart | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/network/util/uri.dart b/lib/network/util/uri.dart index 61f8f6c..015aeee 100644 --- a/lib/network/util/uri.dart +++ b/lib/network/util/uri.dart @@ -18,7 +18,7 @@ class UriBuild { class UriUtils { //map转url参数 - static String mapToQuery(Map? map) { + static String mapToQuery(Map? map) { if (map == null) { return ''; } diff --git a/lib/ui/desktop/toolbar/setting/request_rewrite.dart b/lib/ui/desktop/toolbar/setting/request_rewrite.dart index d2008ab..c2ec152 100644 --- a/lib/ui/desktop/toolbar/setting/request_rewrite.dart +++ b/lib/ui/desktop/toolbar/setting/request_rewrite.dart @@ -67,7 +67,7 @@ class RequestRewriteState extends State { } bool onKeyEvent(KeyEvent event) { - if (event.logicalKey == LogicalKeyboardKey.escape && Navigator.canPop(context)) { + if (HardwareKeyboard.instance.isLogicalKeyPressed(LogicalKeyboardKey.escape) && Navigator.canPop(context)) { Navigator.maybePop(context); return true; } diff --git a/lib/ui/desktop/toolbar/setting/script.dart b/lib/ui/desktop/toolbar/setting/script.dart index 90b116d..1a49614 100644 --- a/lib/ui/desktop/toolbar/setting/script.dart +++ b/lib/ui/desktop/toolbar/setting/script.dart @@ -76,6 +76,11 @@ class _ScriptWidgetState extends State { } bool onKeyEvent(KeyEvent event) { + if (HardwareKeyboard.instance.isLogicalKeyPressed(LogicalKeyboardKey.escape) && Navigator.canPop(context)) { + Navigator.maybePop(context); + return true; + } + if ((HardwareKeyboard.instance.isMetaPressed || HardwareKeyboard.instance.isControlPressed) && event.logicalKey == LogicalKeyboardKey.keyW) { HardwareKeyboard.instance.removeHandler(onKeyEvent);