cake_wallet/lib/src/domain/common/qr_scanner.dart

16 lines
320 B
Dart
Raw Normal View History

2020-01-04 19:31:52 +00:00
import 'package:barcode_scan/barcode_scan.dart';
var isQrScannerShown = false;
Future<String> presentQRScanner() async {
isQrScannerShown = true;
try {
final result = await BarcodeScanner.scan();
isQrScannerShown = false;
return result;
} catch (e) {
isQrScannerShown = false;
2020-01-08 12:26:34 +00:00
rethrow;
2020-01-04 19:31:52 +00:00
}
}