cake_wallet/lib/entities/qr_scanner.dart

16 lines
340 B
Dart
Raw Normal View History

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