merge mobile/desktop remote toobar code

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-04-12 09:41:13 +08:00
parent af01581abb
commit b2c0590898
8 changed files with 882 additions and 999 deletions

View File

@@ -77,15 +77,8 @@ class _RemotePageState extends State<RemotePage>
late FFI _ffi;
void _initStates(String id) {
PrivacyModeState.init(id);
BlockInputState.init(id);
CurrentDisplayState.init(id);
KeyboardEnabledState.init(id);
ShowRemoteCursorState.init(id);
RemoteCursorMovedState.init(id);
final optZoomCursor = 'zoom-cursor';
PeerBoolOption.init(id, optZoomCursor, () => false);
_zoomCursor = PeerBoolOption.find(id, optZoomCursor);
initSharedStates(id);
_zoomCursor = PeerBoolOption.find(id, 'zoom-cursor');
_showRemoteCursor = ShowRemoteCursorState.find(id);
_keyboardEnabled = KeyboardEnabledState.find(id);
_remoteCursorMoved = RemoteCursorMovedState.find(id);
@@ -93,15 +86,6 @@ class _RemotePageState extends State<RemotePage>
_textureId = RxInt(-1);
}
void _removeStates(String id) {
PrivacyModeState.delete(id);
BlockInputState.delete(id);
CurrentDisplayState.delete(id);
ShowRemoteCursorState.delete(id);
KeyboardEnabledState.delete(id);
RemoteCursorMovedState.delete(id);
}
@override
void initState() {
super.initState();
@@ -217,7 +201,7 @@ class _RemotePageState extends State<RemotePage>
}
Get.delete<FFI>(tag: widget.id);
super.dispose();
_removeStates(widget.id);
removeSharedStates(widget.id);
}
Widget buildBody(BuildContext context) {