cake_wallet/lib/entities/qr_scanner.dart

16 lines
331 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;
2020-05-26 15:27:10 +00:00
return result.rawContent;
2020-01-04 19:31:52 +00:00
} catch (e) {
isQrScannerShown = false;
2020-01-08 12:26:34 +00:00
rethrow;
2020-01-04 19:31:52 +00:00
}
}