diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 5c362a71f..8c6381672 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -31,7 +31,6 @@ import 'mobile/pages/file_manager_page.dart'; import 'mobile/pages/remote_page.dart'; import 'desktop/pages/remote_page.dart' as desktop_remote; import 'package:flutter_hbb/desktop/widgets/remote_toolbar.dart'; -import 'models/input_model.dart'; import 'models/model.dart'; import 'models/platform_model.dart'; @@ -3448,7 +3447,12 @@ setResizable(bool resizable) { isOptionFixed(String key) => bind.mainIsOptionFixed(key: key); -final isCustomClient = bind.isCustomClient(); +bool? _isCustomClient; +bool get isCustomClient { + _isCustomClient ??= bind.isCustomClient(); + return _isCustomClient!; +} + get defaultOptionLang => isCustomClient ? 'default' : ''; get defaultOptionTheme => isCustomClient ? 'system' : ''; get defaultOptionYes => isCustomClient ? 'Y' : ''; diff --git a/flutter/lib/common/widgets/address_book.dart b/flutter/lib/common/widgets/address_book.dart index bb553683c..52b2e3d62 100644 --- a/flutter/lib/common/widgets/address_book.dart +++ b/flutter/lib/common/widgets/address_book.dart @@ -35,11 +35,6 @@ class AddressBook extends StatefulWidget { class _AddressBookState extends State { var menuPos = RelativeRect.fill; - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) => Obx(() { if (!gFFI.userModel.isLogin) { diff --git a/flutter/lib/common/widgets/login.dart b/flutter/lib/common/widgets/login.dart index 92528d5e3..71f3dacc3 100644 --- a/flutter/lib/common/widgets/login.dart +++ b/flutter/lib/common/widgets/login.dart @@ -142,11 +142,6 @@ class _WidgetOPState extends State { String _failedMsg = ''; String _url = ''; - @override - void initState() { - super.initState(); - } - @override void dispose() { super.dispose(); diff --git a/flutter/lib/common/widgets/my_group.dart b/flutter/lib/common/widgets/my_group.dart index fd8b9eeb8..e139ce700 100644 --- a/flutter/lib/common/widgets/my_group.dart +++ b/flutter/lib/common/widgets/my_group.dart @@ -23,11 +23,6 @@ class _MyGroupState extends State { RxString get searchUserText => gFFI.groupModel.searchUserText; static TextEditingController searchUserController = TextEditingController(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return Obx(() { diff --git a/flutter/lib/common/widgets/overlay.dart b/flutter/lib/common/widgets/overlay.dart index 145afc3b0..9b20136e1 100644 --- a/flutter/lib/common/widgets/overlay.dart +++ b/flutter/lib/common/widgets/overlay.dart @@ -353,7 +353,7 @@ class Draggable extends StatefulWidget { final Widget Function(BuildContext, GestureDragUpdateCallback) builder; @override - State createState() => _DraggableState(); + State createState() => _DraggableState(chatModel); } class _DraggableState extends State { @@ -362,10 +362,8 @@ class _DraggableState extends State { double _saveHeight = 0; double _lastBottomHeight = 0; - @override - void initState() { - super.initState(); - _chatModel = widget.chatModel; + _DraggableState(ChatModel? chatModel) { + _chatModel = chatModel; } get position => widget.position.pos; @@ -467,7 +465,8 @@ class IOSDraggable extends StatefulWidget { final Widget Function(BuildContext) builder; @override - IOSDraggableState createState() => IOSDraggableState(); + IOSDraggableState createState() => + IOSDraggableState(chatModel, width, height); } class IOSDraggableState extends State { @@ -478,12 +477,10 @@ class IOSDraggableState extends State { double _saveHeight = 0; double _lastBottomHeight = 0; - @override - void initState() { - super.initState(); - _chatModel = widget.chatModel; - _width = widget.width; - _height = widget.height; + IOSDraggableState(ChatModel? chatModel, double w, double h) { + _chatModel = chatModel; + _width = w; + _height = h; } DraggableKeyPosition get position => widget.position; diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart index 66fba2312..8fe731449 100644 --- a/flutter/lib/common/widgets/peer_tab_page.dart +++ b/flutter/lib/common/widgets/peer_tab_page.dart @@ -76,15 +76,11 @@ class _PeerTabPageState extends State final isOptVisiableFixed = isOptionFixed(kOptionPeerTabVisible); - @override - void initState() { - WidgetsBinding.instance.addPostFrameCallback((_) { - _loadLocalOptions(); - }); - super.initState(); + _PeerTabPageState() { + _loadLocalOptions(); } - Future _loadLocalOptions() async { + void _loadLocalOptions() { final uiType = bind.getLocalFlutterOption(k: kOptionPeerCardUiType); if (uiType != '') { peerCardUiType.value = int.parse(uiType) == 0 @@ -878,18 +874,13 @@ class PeerSortDropdown extends StatefulWidget { } class _PeerSortDropdownState extends State { - @override - void initState() { + _PeerSortDropdownState() { if (!PeerSortType.values.contains(peerSort.value)) { - // do not change obx directly in initState, so do in future. - WidgetsBinding.instance.addPostFrameCallback((_) { - _loadLocalOptions(); - }); + _loadLocalOptions(); } - super.initState(); } - Future _loadLocalOptions() async { + void _loadLocalOptions() { peerSort.value = PeerSortType.remoteId; bind.setLocalFlutterOption( k: kOptionPeerSorting, diff --git a/flutter/lib/common/widgets/peers_view.dart b/flutter/lib/common/widgets/peers_view.dart index ec173e294..ef9647eaa 100644 --- a/flutter/lib/common/widgets/peers_view.dart +++ b/flutter/lib/common/widgets/peers_view.dart @@ -45,10 +45,14 @@ class LoadEvent { final peerSearchText = "".obs; /// for peer sort, global obs value -final peerSort = bind.getLocalFlutterOption(k: kOptionPeerSorting).obs; +RxString? _peerSort; +RxString get peerSort { + _peerSort ??= bind.getLocalFlutterOption(k: kOptionPeerSorting).obs; + return _peerSort!; +} // list for listener -final obslist = [peerSearchText, peerSort].obs; +RxList get obslist => [peerSearchText, peerSort].obs; final peerSearchTextController = TextEditingController(text: peerSearchText.value); diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index 797cafcbe..1403d4493 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -212,14 +212,14 @@ class _ConnectionPageState extends State void initState() { super.initState(); if (_idController.text.isEmpty) { - () async { + WidgetsBinding.instance.addPostFrameCallback((_) async { final lastRemoteId = await bind.mainGetLastRemoteId(); if (lastRemoteId != _idController.id) { setState(() { _idController.id = lastRemoteId; }); } - }(); + }); } Get.put(_idController); windowManager.addListener(this); diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 16b97848c..79c18c521 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -78,7 +78,8 @@ class DesktopSettingPage extends StatefulWidget { DesktopSettingPage({Key? key, required this.initialTabkey}) : super(key: key); @override - State createState() => _DesktopSettingPageState(); + State createState() => + _DesktopSettingPageState(initialTabkey); static void switch2page(SettingsTabKey page) { try { @@ -111,10 +112,8 @@ class _DesktopSettingPageState extends State @override bool get wantKeepAlive => true; - @override - void initState() { - super.initState(); - var initialIndex = DesktopSettingPage.tabKeys.indexOf(widget.initialTabkey); + _DesktopSettingPageState(SettingsTabKey initialTabkey) { + var initialIndex = DesktopSettingPage.tabKeys.indexOf(initialTabkey); if (initialIndex == -1) { initialIndex = 0; } diff --git a/flutter/lib/desktop/pages/desktop_tab_page.dart b/flutter/lib/desktop/pages/desktop_tab_page.dart index ce4d02e37..2e577e625 100644 --- a/flutter/lib/desktop/pages/desktop_tab_page.dart +++ b/flutter/lib/desktop/pages/desktop_tab_page.dart @@ -44,21 +44,9 @@ class _DesktopTabPageState extends State final RxBool _block = false.obs; // bool mouseIn = false; - @override - void didChangeAppLifecycleState(AppLifecycleState state) { - super.didChangeAppLifecycleState(state); - if (state == AppLifecycleState.resumed) { - shouldBeBlocked(_block, canBeBlocked); - } else if (state == AppLifecycleState.inactive) {} - } - - @override - void initState() { - super.initState(); - // HardwareKeyboard.instance.addHandler(_handleKeyEvent); - WidgetsBinding.instance.addObserver(this); - Get.put(tabController); + _DesktopTabPageState() { RemoteCountState.init(); + Get.put(tabController); tabController.add(TabInfo( key: kTabLabelHomePage, label: kTabLabelHomePage, @@ -81,6 +69,21 @@ class _DesktopTabPageState extends State } } + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + super.didChangeAppLifecycleState(state); + if (state == AppLifecycleState.resumed) { + shouldBeBlocked(_block, canBeBlocked); + } else if (state == AppLifecycleState.inactive) {} + } + + @override + void initState() { + super.initState(); + // HardwareKeyboard.instance.addHandler(_handleKeyEvent); + WidgetsBinding.instance.addObserver(this); + } + /* bool _handleKeyEvent(KeyEvent event) { if (!mouseIn && event is KeyDownEvent) { diff --git a/flutter/lib/desktop/pages/file_manager_tab_page.dart b/flutter/lib/desktop/pages/file_manager_tab_page.dart index 8680806e0..0cba76e00 100644 --- a/flutter/lib/desktop/pages/file_manager_tab_page.dart +++ b/flutter/lib/desktop/pages/file_manager_tab_page.dart @@ -34,6 +34,7 @@ class _FileManagerTabPageState extends State { WindowController.fromWindowId(windowId()) .setTitle(getWindowNameWithId(id)); }; + tabController.onRemoved = (_, id) => onRemoveId(id); tabController.add(TabInfo( key: params['id'], label: params['id'], @@ -54,8 +55,6 @@ class _FileManagerTabPageState extends State { void initState() { super.initState(); - tabController.onRemoved = (_, id) => onRemoveId(id); - rustDeskWinManager.setMethodHandler((call, fromWindowId) async { print( "[FileTransfer] call ${call.method} with args ${call.arguments} from window $fromWindowId to ${windowId()}"); diff --git a/flutter/lib/desktop/pages/install_page.dart b/flutter/lib/desktop/pages/install_page.dart index 203eabd25..a860fe89e 100644 --- a/flutter/lib/desktop/pages/install_page.dart +++ b/flutter/lib/desktop/pages/install_page.dart @@ -19,9 +19,7 @@ class InstallPage extends StatefulWidget { class _InstallPageState extends State { final tabController = DesktopTabController(tabType: DesktopTabType.main); - @override - void initState() { - super.initState(); + _InstallPageState() { Get.put(tabController); const label = "install"; tabController.add(TabInfo( @@ -73,10 +71,13 @@ class _InstallPageBodyState extends State<_InstallPageBody> padding: EdgeInsets.symmetric(vertical: 15, horizontal: 12), ); + _InstallPageBodyState() { + controller = TextEditingController(text: bind.installInstallPath()); + } + @override void initState() { windowManager.addListener(this); - controller = TextEditingController(text: bind.installInstallPath()); super.initState(); } diff --git a/flutter/lib/desktop/pages/port_forward_tab_page.dart b/flutter/lib/desktop/pages/port_forward_tab_page.dart index ac94890b6..b20d731b2 100644 --- a/flutter/lib/desktop/pages/port_forward_tab_page.dart +++ b/flutter/lib/desktop/pages/port_forward_tab_page.dart @@ -34,6 +34,7 @@ class _PortForwardTabPageState extends State { WindowController.fromWindowId(windowId()) .setTitle(getWindowNameWithId(id)); }; + tabController.onRemoved = (_, id) => onRemoveId(id); tabController.add(TabInfo( key: params['id'], label: params['id'], @@ -54,8 +55,6 @@ class _PortForwardTabPageState extends State { void initState() { super.initState(); - tabController.onRemoved = (_, id) => onRemoveId(id); - rustDeskWinManager.setMethodHandler((call, fromWindowId) async { debugPrint( "[Port Forward] call ${call.method} with args ${call.arguments} from window $fromWindowId"); diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index 08656a4df..d1c1056be 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -64,7 +64,7 @@ class RemotePage extends StatefulWidget { @override State createState() { - final state = _RemotePageState(); + final state = _RemotePageState(id); _lastState.value = state; return state; } @@ -94,6 +94,10 @@ class _RemotePageState extends State SessionID get sessionId => _ffi.sessionId; + _RemotePageState(String id) { + _initStates(id); + } + void _initStates(String id) { initSharedStates(id); _zoomCursor = PeerBoolOption.find(id, kOptionZoomCursor); @@ -105,7 +109,6 @@ class _RemotePageState extends State @override void initState() { super.initState(); - _initStates(widget.id); _ffi = FFI(widget.sessionId); Get.put(_ffi, tag: widget.id); _ffi.imageModel.addCallbackOnFirstImage((String peerId) { @@ -570,11 +573,6 @@ class _ImagePaintState extends State { RxBool get remoteCursorMoved => widget.remoteCursorMoved; Widget Function(Widget)? get listenerBuilder => widget.listenerBuilder; - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { final m = Provider.of(context); diff --git a/flutter/lib/desktop/pages/remote_tab_page.dart b/flutter/lib/desktop/pages/remote_tab_page.dart index f07b95382..f43008755 100644 --- a/flutter/lib/desktop/pages/remote_tab_page.dart +++ b/flutter/lib/desktop/pages/remote_tab_page.dart @@ -71,7 +71,7 @@ class _ConnectionTabPageState extends State { final ffi = remotePage.ffi; bind.setCurSessionId(sessionId: ffi.sessionId); } - WindowController.fromWindowId(windowId()) + WindowController.fromWindowId(params['windowId']) .setTitle(getWindowNameWithId(id)); UnreadChatCountState.find(id).value = 0; }; @@ -98,15 +98,14 @@ class _ConnectionTabPageState extends State { )); _update_remote_count(); } + tabController.onRemoved = (_, id) => onRemoveId(id); + rustDeskWinManager.setMethodHandler(_remoteMethodHandler); } @override void initState() { super.initState(); - tabController.onRemoved = (_, id) => onRemoveId(id); - - rustDeskWinManager.setMethodHandler(_remoteMethodHandler); if (!_isScreenRectSet) { Future.delayed(Duration.zero, () { restoreWindowPosition( @@ -121,11 +120,6 @@ class _ConnectionTabPageState extends State { } } - @override - void dispose() { - super.dispose(); - } - @override Widget build(BuildContext context) { final child = Scaffold( diff --git a/flutter/lib/desktop/pages/server_page.dart b/flutter/lib/desktop/pages/server_page.dart index 9701ca409..a05243747 100644 --- a/flutter/lib/desktop/pages/server_page.dart +++ b/flutter/lib/desktop/pages/server_page.dart @@ -32,14 +32,18 @@ class DesktopServerPage extends StatefulWidget { class _DesktopServerPageState extends State with WindowListener, AutomaticKeepAliveClientMixin { final tabController = gFFI.serverModel.tabController; - @override - void initState() { + + _DesktopServerPageState() { gFFI.ffiModel.updateEventListener(gFFI.sessionId, ""); - windowManager.addListener(this); Get.put(tabController); tabController.onRemoved = (_, id) { onRemoveId(id); }; + } + + @override + void initState() { + windowManager.addListener(this); super.initState(); } @@ -108,19 +112,7 @@ class ConnectionManagerState extends State with WidgetsBindingObserver { final RxBool _block = false.obs; - @override - void didChangeAppLifecycleState(AppLifecycleState state) { - super.didChangeAppLifecycleState(state); - if (state == AppLifecycleState.resumed) { - if (!allowRemoteCMModification()) { - shouldBeBlocked(_block, null); - } - } - } - - @override - void initState() { - gFFI.serverModel.updateClientState(); + ConnectionManagerState() { gFFI.serverModel.tabController.onSelected = (client_id_str) { final client_id = int.tryParse(client_id_str); if (client_id != null) { @@ -140,6 +132,21 @@ class ConnectionManagerState extends State } }; gFFI.chatModel.isConnManager = true; + } + + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + super.didChangeAppLifecycleState(state); + if (state == AppLifecycleState.resumed) { + if (!allowRemoteCMModification()) { + shouldBeBlocked(_block, null); + } + } + } + + @override + void initState() { + gFFI.serverModel.updateClientState(); WidgetsBinding.instance.addObserver(this); super.initState(); } diff --git a/flutter/lib/desktop/widgets/popup_menu.dart b/flutter/lib/desktop/widgets/popup_menu.dart index 003979a70..28432a978 100644 --- a/flutter/lib/desktop/widgets/popup_menu.dart +++ b/flutter/lib/desktop/widgets/popup_menu.dart @@ -38,24 +38,16 @@ class PopupMenuChildrenItem extends mod_menu.PopupMenuEntry { @override MyPopupMenuItemState> createState() => - MyPopupMenuItemState>(); + MyPopupMenuItemState>(enabled?.value); } class MyPopupMenuItemState> extends State { RxBool enabled = true.obs; - @override - void initState() { - super.initState(); - WidgetsBinding.instance.addPostFrameCallback((_) { - _initEnabled(); - }); - } - - Future _initEnabled() async { - if (widget.enabled != null) { - enabled.value = widget.enabled!.value; + MyPopupMenuItemState(bool? e) { + if (e != null) { + enabled.value = e; } } diff --git a/flutter/lib/desktop/widgets/remote_toolbar.dart b/flutter/lib/desktop/widgets/remote_toolbar.dart index cfc52c777..98fa67614 100644 --- a/flutter/lib/desktop/widgets/remote_toolbar.dart +++ b/flutter/lib/desktop/widgets/remote_toolbar.dart @@ -1032,11 +1032,6 @@ class _DisplayMenuState extends State<_DisplayMenu> { FFI get ffi => widget.ffi; String get id => widget.id; - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { _screenAdjustor.updateScreen(); diff --git a/flutter/lib/desktop/widgets/tabbar_widget.dart b/flutter/lib/desktop/widgets/tabbar_widget.dart index a19ce105b..fca6efb2e 100644 --- a/flutter/lib/desktop/widgets/tabbar_widget.dart +++ b/flutter/lib/desktop/widgets/tabbar_widget.dart @@ -227,8 +227,7 @@ typedef TabMenuBuilder = Widget Function(String key); typedef LabelGetter = Rx Function(String key); /// [_lastClickTime], help to handle double click -int _lastClickTime = - DateTime.now().millisecondsSinceEpoch - bind.getDoubleClickTime() - 1000; +int _lastClickTime = 0; class DesktopTab extends StatefulWidget { final bool showLogo; @@ -727,16 +726,6 @@ class WindowActionPanel extends StatefulWidget { } class WindowActionPanelState extends State { - @override - void initState() { - super.initState(); - } - - @override - void dispose() { - super.dispose(); - } - bool showTabDowndown() { return widget.tabController.state.value.tabs.length > 1 && (widget.tabController.tabType == DesktopTabType.remoteScreen || @@ -1273,14 +1262,6 @@ class ActionIcon extends StatefulWidget { class _ActionIconState extends State { final hover = false.obs; - @override - void initState() { - super.initState(); - WidgetsBinding.instance.addPostFrameCallback((_) { - hover.value = false; - }); - } - @override Widget build(BuildContext context) { return Tooltip( diff --git a/flutter/lib/mobile/pages/connection_page.dart b/flutter/lib/mobile/pages/connection_page.dart index 914fdec34..02c552d71 100644 --- a/flutter/lib/mobile/pages/connection_page.dart +++ b/flutter/lib/mobile/pages/connection_page.dart @@ -50,10 +50,17 @@ class _ConnectionPageState extends State { bool isPeersLoaded = false; StreamSubscription? _uniLinksSubscription; + _ConnectionPageState() { + if (!isWeb) _uniLinksSubscription = listenUniLinks(); + _idController.addListener(() { + _idEmpty.value = _idController.text.isEmpty; + }); + Get.put(_idController); + } + @override void initState() { super.initState(); - if (!isWeb) _uniLinksSubscription = listenUniLinks(); if (_idController.text.isEmpty) { WidgetsBinding.instance.addPostFrameCallback((_) async { final lastRemoteId = await bind.mainGetLastRemoteId(); @@ -72,11 +79,6 @@ class _ConnectionPageState extends State { }); } } - - _idController.addListener(() { - _idEmpty.value = _idController.text.isEmpty; - }); - Get.put(_idController); } @override diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index 3b962a1c3..74b56cd45 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -34,7 +34,7 @@ class RemotePage extends StatefulWidget { final bool? isSharedPassword; @override - State createState() => _RemotePageState(); + State createState() => _RemotePageState(id); } class _RemotePageState extends State { @@ -58,6 +58,12 @@ class _RemotePageState extends State { final TextEditingController _textController = TextEditingController(text: initText); + _RemotePageState(String id) { + initSharedStates(id); + gFFI.chatModel.voiceCallStatus.value = VoiceCallStatus.notStarted; + gFFI.dialogManager.loadMobileActionsOverlayVisible(); + } + @override void initState() { super.initState(); @@ -80,13 +86,8 @@ class _RemotePageState extends State { gFFI.qualityMonitorModel.checkShowQualityMonitor(sessionId); keyboardSubscription = keyboardVisibilityController.onChange.listen(onSoftKeyboardChanged); - initSharedStates(widget.id); gFFI.chatModel .changeCurrentKey(MessageKey(widget.id, ChatModel.clientModeID)); - WidgetsBinding.instance.addPostFrameCallback((_) { - gFFI.chatModel.voiceCallStatus.value = VoiceCallStatus.notStarted; - gFFI.dialogManager.loadMobileActionsOverlayVisible(); - }); _blockableOverlayState.applyFfi(gFFI); } @@ -778,11 +779,6 @@ class _KeyHelpToolsState extends State { onPressed: onPressed); } - @override - void initState() { - super.initState(); - } - _updateRect() { RenderObject? renderObject = _key.currentContext?.findRenderObject(); if (renderObject == null) { diff --git a/flutter/lib/mobile/pages/settings_page.dart b/flutter/lib/mobile/pages/settings_page.dart index 72e48c6f5..c817fda4e 100644 --- a/flutter/lib/mobile/pages/settings_page.dart +++ b/flutter/lib/mobile/pages/settings_page.dart @@ -88,11 +88,7 @@ class _SettingsState extends State with WidgetsBindingObserver { var _hideProxy = false; var _hideNetwork = false; - @override - void initState() { - super.initState(); - WidgetsBinding.instance.addObserver(this); - + _SettingsState() { _enableAbr = option2bool( kOptionEnableAbr, bind.mainGetOptionSync(key: kOptionEnableAbr)); _denyLANDiscovery = !option2bool(kOptionEnableLanDiscovery, @@ -117,6 +113,12 @@ class _SettingsState extends State with WidgetsBindingObserver { _hideProxy = bind.mainGetBuildinOption(key: kOptionHideProxySetting) == 'Y'; _hideNetwork = bind.mainGetBuildinOption(key: kOptionHideNetworkSetting) == 'Y'; + } + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addPostFrameCallback((_) async { var update = false; diff --git a/flutter/lib/mobile/widgets/gesture_help.dart b/flutter/lib/mobile/widgets/gesture_help.dart index f4c5a35a4..5ba696489 100644 --- a/flutter/lib/mobile/widgets/gesture_help.dart +++ b/flutter/lib/mobile/widgets/gesture_help.dart @@ -41,18 +41,16 @@ class GestureHelp extends StatefulWidget { final OnTouchModeChange onTouchModeChange; @override - State createState() => _GestureHelpState(); + State createState() => _GestureHelpState(touchMode); } class _GestureHelpState extends State { - var _selectedIndex; - var _touchMode; + late int _selectedIndex; + late bool _touchMode; - @override - void initState() { - _touchMode = widget.touchMode; + _GestureHelpState(bool touchMode) { + _touchMode = touchMode; _selectedIndex = _touchMode ? 1 : 0; - super.initState(); } @override diff --git a/src/server/audio_service.rs b/src/server/audio_service.rs index b717c6644..f227bd232 100644 --- a/src/server/audio_service.rs +++ b/src/server/audio_service.rs @@ -230,7 +230,6 @@ mod cpal_impl { #[cfg(windows)] fn get_device() -> ResultType<(Device, SupportedStreamConfig)> { let audio_input = super::get_audio_input(); - println!("REMOVE ME =============================== use audio input: {}", &audio_input); if !audio_input.is_empty() { return get_audio_input(&audio_input); }