diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 5313a9e85165..5c927521388e 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1428,7 +1428,7 @@ Future initGlobalFFI() async { _globalFFI = FFI(null); debugPrint("_globalFFI init end"); // after `put`, can also be globally found by Get.find(); - Get.put(_globalFFI, permanent: true); + Get.put(_globalFFI, permanent: true); } String translate(String name) { diff --git a/flutter/lib/common/shared_state.dart b/flutter/lib/common/shared_state.dart index bd95f1db94ee..908c98a70e3e 100644 --- a/flutter/lib/common/shared_state.dart +++ b/flutter/lib/common/shared_state.dart @@ -10,16 +10,16 @@ class PrivacyModeState { static void init(String id) { final key = tag(id); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final RxString state = ''.obs; - Get.put(state, tag: key); + Get.put(state, tag: key); } } static void delete(String id) { final key = tag(id); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } else { Get.find(tag: key).value = ''; } @@ -33,9 +33,9 @@ class BlockInputState { static void init(String id) { final key = tag(id); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final RxBool state = false.obs; - Get.put(state, tag: key); + Get.put(state, tag: key); } else { Get.find(tag: key).value = false; } @@ -43,8 +43,8 @@ class BlockInputState { static void delete(String id) { final key = tag(id); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } @@ -56,9 +56,9 @@ class CurrentDisplayState { static void init(String id) { final key = tag(id); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final RxInt state = RxInt(0); - Get.put(state, tag: key); + Get.put(state, tag: key); } else { Get.find(tag: key).value = 0; } @@ -66,8 +66,8 @@ class CurrentDisplayState { static void delete(String id) { final key = tag(id); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } @@ -105,16 +105,16 @@ class ConnectionTypeState { static void init(String id) { final key = tag(id); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final ConnectionType collectionType = ConnectionType(); - Get.put(collectionType, tag: key); + Get.put(collectionType, tag: key); } } static void delete(String id) { final key = tag(id); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } @@ -127,9 +127,9 @@ class FingerprintState { static void init(String id) { final key = tag(id); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final RxString state = ''.obs; - Get.put(state, tag: key); + Get.put(state, tag: key); } else { Get.find(tag: key).value = ''; } @@ -137,8 +137,8 @@ class FingerprintState { static void delete(String id) { final key = tag(id); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } @@ -150,9 +150,9 @@ class ShowRemoteCursorState { static void init(String id) { final key = tag(id); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final RxBool state = false.obs; - Get.put(state, tag: key); + Get.put(state, tag: key); } else { Get.find(tag: key).value = false; } @@ -160,8 +160,8 @@ class ShowRemoteCursorState { static void delete(String id) { final key = tag(id); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } @@ -173,9 +173,9 @@ class ShowRemoteCursorLockState { static void init(String id) { final key = tag(id); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final RxBool state = false.obs; - Get.put(state, tag: key); + Get.put(state, tag: key); } else { Get.find(tag: key).value = false; } @@ -183,8 +183,8 @@ class ShowRemoteCursorLockState { static void delete(String id) { final key = tag(id); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } @@ -196,10 +196,10 @@ class KeyboardEnabledState { static void init(String id) { final key = tag(id); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { // Server side, default true final RxBool state = true.obs; - Get.put(state, tag: key); + Get.put(state, tag: key); } else { Get.find(tag: key).value = true; } @@ -207,8 +207,8 @@ class KeyboardEnabledState { static void delete(String id) { final key = tag(id); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } @@ -220,9 +220,9 @@ class RemoteCursorMovedState { static void init(String id) { final key = tag(id); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final RxBool state = false.obs; - Get.put(state, tag: key); + Get.put(state, tag: key); } else { Get.find(tag: key).value = false; } @@ -230,8 +230,8 @@ class RemoteCursorMovedState { static void delete(String id) { final key = tag(id); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } @@ -243,9 +243,9 @@ class RemoteCountState { static void init() { final key = tag(); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final RxInt state = 1.obs; - Get.put(state, tag: key); + Get.put(state, tag: key); } else { Get.find(tag: key).value = 1; } @@ -253,8 +253,8 @@ class RemoteCountState { static void delete() { final key = tag(); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } @@ -266,9 +266,9 @@ class PeerBoolOption { static void init(String id, String opt, bool Function() init_getter) { final key = tag(id, opt); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final RxBool value = RxBool(init_getter()); - Get.put(value, tag: key); + Get.put(value, tag: key); } else { Get.find(tag: key).value = init_getter(); } @@ -276,8 +276,8 @@ class PeerBoolOption { static void delete(String id, String opt) { final key = tag(id, opt); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } @@ -290,9 +290,9 @@ class PeerStringOption { static void init(String id, String opt, String Function() init_getter) { final key = tag(id, opt); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final RxString value = RxString(init_getter()); - Get.put(value, tag: key); + Get.put(value, tag: key); } else { Get.find(tag: key).value = init_getter(); } @@ -300,8 +300,8 @@ class PeerStringOption { static void delete(String id, String opt) { final key = tag(id, opt); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } @@ -314,9 +314,9 @@ class UnreadChatCountState { static void init(String id) { final key = tag(id); - if (!Get.isRegistered(tag: key)) { + if (!Get.isRegistered(tag: key)) { final RxInt state = RxInt(0); - Get.put(state, tag: key); + Get.put(state, tag: key); } else { Get.find(tag: key).value = 0; } @@ -324,8 +324,8 @@ class UnreadChatCountState { static void delete(String id) { final key = tag(id); - if (Get.isRegistered(tag: key)) { - Get.delete(tag: key); + if (Get.isRegistered(tag: key)) { + Get.delete(tag: key); } } diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index d3b6add8ae71..0035ef4931d6 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -84,8 +84,10 @@ class DesktopSettingPage extends StatefulWidget { } if (Get.isRegistered(tag: _kSettingPageControllerTag)) { DesktopTabPage.onAddSetting(initialPage: page); - PageController controller = Get.find(tag: _kSettingPageControllerTag); - Rx selected = Get.find(tag: _kSettingPageTabKeyTag); + PageController controller = + Get.find(tag: _kSettingPageControllerTag); + Rx selected = + Get.find>(tag: _kSettingPageTabKeyTag); selected.value = page; controller.jumpToPage(index); } else { diff --git a/flutter/lib/desktop/pages/desktop_tab_page.dart b/flutter/lib/desktop/pages/desktop_tab_page.dart index e611aca44f90..0f7e77c810b0 100644 --- a/flutter/lib/desktop/pages/desktop_tab_page.dart +++ b/flutter/lib/desktop/pages/desktop_tab_page.dart @@ -20,7 +20,7 @@ class DesktopTabPage extends StatefulWidget { static void onAddSetting( {SettingsTabKey initialPage = SettingsTabKey.general}) { try { - DesktopTabController tabController = Get.find(); + DesktopTabController tabController = Get.find(); tabController.add(TabInfo( key: kTabLabelSettingPage, label: kTabLabelSettingPage, diff --git a/flutter/lib/desktop/pages/file_manager_page.dart b/flutter/lib/desktop/pages/file_manager_page.dart index c429fa24560b..29ab0f806937 100644 --- a/flutter/lib/desktop/pages/file_manager_page.dart +++ b/flutter/lib/desktop/pages/file_manager_page.dart @@ -92,7 +92,7 @@ class _FileManagerPageState extends State _ffi.dialogManager .showLoading(translate('Connecting...'), onCancel: closeConnection); }); - Get.put(_ffi, tag: 'ft_${widget.id}'); + Get.put(_ffi, tag: 'ft_${widget.id}'); if (!isLinux) { WakelockPlus.enable(); } diff --git a/flutter/lib/desktop/pages/port_forward_page.dart b/flutter/lib/desktop/pages/port_forward_page.dart index b9a3248facf3..99f8df3409e4 100644 --- a/flutter/lib/desktop/pages/port_forward_page.dart +++ b/flutter/lib/desktop/pages/port_forward_page.dart @@ -63,7 +63,7 @@ class _PortForwardPageState extends State isSharedPassword: widget.isSharedPassword, forceRelay: widget.forceRelay, isRdp: widget.isRDP); - Get.put(_ffi, tag: 'pf_${widget.id}'); + Get.put(_ffi, tag: 'pf_${widget.id}'); debugPrint("Port forward page init success with id ${widget.id}"); widget.tabController.onSelected?.call(widget.id); } diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index 8427645e2f8b..4d61c373892f 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -107,7 +107,7 @@ class _RemotePageState extends State super.initState(); _initStates(widget.id); _ffi = FFI(widget.sessionId); - Get.put(_ffi, tag: widget.id); + Get.put(_ffi, tag: widget.id); _ffi.imageModel.addCallbackOnFirstImage((String peerId) { showKBLayoutTypeChooserIfNeeded( _ffi.ffiModel.pi.platform, _ffi.dialogManager); diff --git a/flutter/lib/desktop/pages/server_page.dart b/flutter/lib/desktop/pages/server_page.dart index 2ccad8c329de..4af54b9af296 100644 --- a/flutter/lib/desktop/pages/server_page.dart +++ b/flutter/lib/desktop/pages/server_page.dart @@ -36,7 +36,7 @@ class _DesktopServerPageState extends State void initState() { gFFI.ffiModel.updateEventListener(gFFI.sessionId, ""); windowManager.addListener(this); - Get.put(tabController); + Get.put(tabController); tabController.onRemoved = (_, id) { onRemoveId(id); };