🐛 Bug fixes and optimization

This commit is contained in:
2025-10-12 20:45:10 +08:00
parent e2d315afd4
commit ad9fb0719a
7 changed files with 186 additions and 57 deletions

View File

@@ -97,7 +97,7 @@ class WindowScaffold extends HookConsumerWidget {
LogicalKeySet(LogicalKeyboardKey.escape): const PopIntent(),
},
child: Actions(
actions: <Type, Action<Intent>>{PopIntent: PopAction(context)},
actions: <Type, Action<Intent>>{PopIntent: PopAction(ref)},
child: Material(
color: Theme.of(context).colorScheme.surfaceContainer,
child: Stack(
@@ -206,7 +206,7 @@ class WindowScaffold extends HookConsumerWidget {
LogicalKeySet(LogicalKeyboardKey.escape): const PopIntent(),
},
child: Actions(
actions: <Type, Action<Intent>>{PopIntent: PopAction(context)},
actions: <Type, Action<Intent>>{PopIntent: PopAction(ref)},
child: Stack(
fit: StackFit.expand,
children: [Positioned.fill(child: child), _WebSocketIndicator()],
@@ -351,14 +351,14 @@ class PopIntent extends Intent {
}
class PopAction extends Action<PopIntent> {
final BuildContext context;
final WidgetRef ref;
PopAction(this.context);
PopAction(this.ref);
@override
void invoke(PopIntent intent) {
if (context.canPop()) {
context.pop();
if (ref.watch(routerProvider).canPop()) {
ref.read(routerProvider).pop();
}
}
}