listen and connect to uni link mobile

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
This commit is contained in:
Sahil Yeole
2023-11-02 02:13:33 +05:30
parent d0b9dd9ae7
commit b1682d5794
2 changed files with 20 additions and 4 deletions

View File

@@ -54,10 +54,12 @@ class _ConnectionPageState extends State<ConnectionPage> {
}
bool isPeersLoading = false;
bool isPeersLoaded = false;
StreamSubscription? _uniLinksSubscription;
@override
void initState() {
super.initState();
_uniLinksSubscription = listenUniLinks();
if (_idController.text.isEmpty) {
() async {
final lastRemoteId = await bind.mainGetLastRemoteId();
@@ -312,6 +314,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
@override
void dispose() {
_uniLinksSubscription?.cancel();
_idController.dispose();
if (Get.isRegistered<IDTextEditingController>()) {
Get.delete<IDTextEditingController>();