Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-10-16 21:54:59 +08:00
parent bebf34db23
commit a161fa5e58
3 changed files with 14 additions and 4 deletions

View File

@@ -295,10 +295,15 @@ class MyApp extends StatelessWidget {
Get.back();
}
return Shortcuts(
shortcuts: {
LogicalKeySet(LogicalKeyboardKey.escape):
VoidCallbackIntent(onBack),
return Focus(
canRequestFocus: false,
onKeyEvent: (_, event) {
if (event.logicalKey == LogicalKeyboardKey.escape &&
event is KeyDownEvent) {
onBack();
return KeyEventResult.handled;
}
return KeyEventResult.ignored;
},
child: MouseBackDetector(
onTapDown: onBack,