Merge branch 'develop' into flutter-3.19.6

This commit is contained in:
wanghongenpin
2024-11-12 09:29:25 +08:00
3 changed files with 7 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ class UriBuild {
class UriUtils {
//map转url参数
static String mapToQuery(Map<String, dynamic>? map) {
static String mapToQuery(Map? map) {
if (map == null) {
return '';
}

View File

@@ -67,7 +67,7 @@ class RequestRewriteState extends State<RequestRewriteWidget> {
}
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;
}

View File

@@ -76,6 +76,11 @@ class _ScriptWidgetState extends State<ScriptWidget> {
}
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);