From ce300aa75fbc5a5a95bc80ddcc11852dbf4ef62d Mon Sep 17 00:00:00 2001
From: Sahil Yeole <sahilyeole93@gmail.com>
Date: Wed, 25 Oct 2023 02:05:17 +0530
Subject: [PATCH 1/2] remove unused onSubmitted

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
---
 flutter/lib/desktop/pages/connection_page.dart | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart
index 670f330bb..cab9b12f7 100644
--- a/flutter/lib/desktop/pages/connection_page.dart
+++ b/flutter/lib/desktop/pages/connection_page.dart
@@ -271,18 +271,6 @@ class _ConnectionPageState extends State<ConnectionPage>
                         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<Peer> onSelected, Iterable<Peer> options) {

From 2cdfeb8dd0bebfad34c17bdf4e3c44ef29358fcd Mon Sep 17 00:00:00 2001
From: Sahil Yeole <sahilyeole93@gmail.com>
Date: Wed, 25 Oct 2023 02:36:23 +0530
Subject: [PATCH 2/2] fix id field ui not updating on peer card connection

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
---
 flutter/lib/common.dart                        | 4 ++++
 flutter/lib/desktop/pages/connection_page.dart | 4 ++++
 2 files changed, 8 insertions(+)

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<IDTextEditingController>();
         idController.text = formatID(id);
       }
+      if (Get.isRegistered<TextEditingController>()){
+        final fieldTextEditingController = Get.find<TextEditingController>();
+        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 cab9b12f7..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<ConnectionPage>
     if (Get.isRegistered<IDTextEditingController>()) {
       Get.delete<IDTextEditingController>();
     }
+    if (Get.isRegistered<TextEditingController>()){
+      Get.delete<TextEditingController>();
+    }
     super.dispose();
   }
 
@@ -235,6 +238,7 @@ class _ConnectionPageState extends State<ConnectionPage>
                         VoidCallback onFieldSubmitted,
                         ) {
                       fieldTextEditingController.text = _idController.text;
+                      Get.put<TextEditingController>(fieldTextEditingController);
                       fieldFocusNode.addListener(() async {
                         _idInputFocused.value = fieldFocusNode.hasFocus;
                         if (fieldFocusNode.hasFocus && !isPeersLoading){