♻️ Decouple the room.dart

This commit is contained in:
2026-01-10 14:18:59 +08:00
parent 64903bf1f3
commit 3847581f1f
9 changed files with 1132 additions and 722 deletions

View File

@@ -146,16 +146,19 @@ class WindowScaffold extends HookConsumerWidget {
},
);
ShakeDetector detector = ShakeDetector.autoStart(
onPhoneShake: (_) {
showPalette.value = true;
},
);
ShakeDetector? detactor;
if (!kIsWeb && (Platform.isIOS && Platform.isAndroid)) {
detactor = ShakeDetector.autoStart(
onPhoneShake: (_) {
showPalette.value = true;
},
);
}
return () {
hotKeyManager.unregister(popHotKey);
hotKeyManager.unregister(cmpHotKey);
detector.stopListening();
detactor?.stopListening();
};
}, []);