Used the new barcode_scan2 package instead (#559)

This commit is contained in:
Omar Hatem 2022-10-24 21:24:20 +02:00 committed by GitHub
parent ca36a425a7
commit fb8017a93c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,17 +1,15 @@
// import 'package:barcode_scan/barcode_scan.dart';
import 'package:barcode_scan2/barcode_scan2.dart';
var isQrScannerShown = false;
Future<String> presentQRScanner() async {
isQrScannerShown = true;
// FIX-ME: BarcodeScanner
throw Exception('Unimplemented');
// try {
// final result = await BarcodeScanner.scan();
// isQrScannerShown = false;
// return result.rawContent;
// } catch (e) {
// isQrScannerShown = false;
// rethrow;
// }
try {
final result = await BarcodeScanner.scan();
isQrScannerShown = false;
return result.rawContent;
} catch (e) {
isQrScannerShown = false;
rethrow;
}
}