From e737257e850d8d44b0df8b25f4fde73d9d1c4131 Mon Sep 17 00:00:00 2001 From: PuPha Date: Wed, 4 Dec 2024 09:30:44 +0700 Subject: [PATCH] Update Scan Item --- lib/screen/scan_qr/scan_qr_page.dart | 58 +--------------------------- 1 file changed, 2 insertions(+), 56 deletions(-) diff --git a/lib/screen/scan_qr/scan_qr_page.dart b/lib/screen/scan_qr/scan_qr_page.dart index d00e58057..d44e94c25 100644 --- a/lib/screen/scan_qr/scan_qr_page.dart +++ b/lib/screen/scan_qr/scan_qr_page.dart @@ -29,8 +29,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:permission_handler/permission_handler.dart'; import 'package:mobile_scanner/mobile_scanner.dart'; +import 'package:permission_handler/permission_handler.dart'; // ignore_for_file: constant_identifier_names @@ -175,8 +175,6 @@ class ScanQRPageState extends State } enum ScannerItem { - WALLET_CONNECT, - BEACON_CONNECT, ETH_ADDRESS, XTZ_ADDRESS, GLOBAL, @@ -184,16 +182,11 @@ enum ScannerItem { List get instructions { switch (this) { - case WALLET_CONNECT: - case BEACON_CONNECT: - return [ScannerInstruction.web3Connect]; case ETH_ADDRESS: case XTZ_ADDRESS: return []; case GLOBAL: return [ - ScannerInstruction.web3Connect, - ScannerInstruction.signTransaction, ScannerInstruction.displayFF, ]; case CANVAS: @@ -634,19 +627,6 @@ class QRScanViewState extends State // dont need to do anything here, // it has been processed in the branch deeplink /// handled with deeplink - case ScannerItem.WALLET_CONNECT: - if (code.startsWith('wc:')) { - await _handleAutonomyConnect(code); - } else { - _handleError(code); - } - - case ScannerItem.BEACON_CONNECT: - if (code.startsWith('tezos://')) { - await _handleBeaconConnect(code); - } else { - _handleError(code); - } case ScannerItem.ETH_ADDRESS: case ScannerItem.XTZ_ADDRESS: @@ -662,11 +642,7 @@ class QRScanViewState extends State } await Future.delayed(const Duration(milliseconds: 300)); case ScannerItem.GLOBAL: - if (code.startsWith('wc:')) { - await _handleAutonomyConnect(code); - } else if (code.startsWith('tezos:')) { - await _handleBeaconConnect(code); - } else { + { _handleError(code); } } @@ -701,36 +677,6 @@ class QRScanViewState extends State '${data.substring(0, data.length ~/ 2)}'); } - Future _handleAutonomyConnect(String code) async { - setState(() { - _isLoading = true; - }); - await pauseCamera(); - if (!mounted) { - return; - } - if (_shouldPop) { - Navigator.pop(context); - } - await Future.delayed(const Duration(seconds: 1)); - } - - Future _handleBeaconConnect(String code) async { - setState(() { - _isLoading = true; - }); - await pauseCamera(); - if (!mounted) { - return; - } - if (_shouldPop) { - Navigator.pop(context); - } - await Future.delayed(const Duration(seconds: 1)); - - await Future.wait([injector().showContactingDialog()]); - } - @override bool get wantKeepAlive => true; }