diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 0ab790720..9c8404c56 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -2024,6 +2024,10 @@ connect( final idController = Get.find(); idController.text = formatID(id); } + if (Get.isRegistered()){ + final fieldTextEditingController = Get.find(); + fieldTextEditingController.text = formatID(id); + } } catch (_) {} } id = id.replaceAll(' ', ''); diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index 670f330bb..a40e8abe0 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -81,6 +81,9 @@ class _ConnectionPageState extends State if (Get.isRegistered()) { Get.delete(); } + if (Get.isRegistered()){ + Get.delete(); + } super.dispose(); } @@ -235,6 +238,7 @@ class _ConnectionPageState extends State VoidCallback onFieldSubmitted, ) { fieldTextEditingController.text = _idController.text; + Get.put(fieldTextEditingController); fieldFocusNode.addListener(() async { _idInputFocused.value = fieldFocusNode.hasFocus; if (fieldFocusNode.hasFocus && !isPeersLoading){ @@ -271,18 +275,6 @@ class _ConnectionPageState extends State onChanged: (v) { _idController.id = v; }, - onSubmitted: (s) { - if (s == '') { - return; - } - try { - final id = int.parse(s); - _idController.id = s; - onConnect(); - } catch (_) { - return; - } - }, )); }, optionsViewBuilder: (BuildContext context, AutocompleteOnSelected onSelected, Iterable options) {