chore: Follow up fix qr code scanner

This commit is contained in:
Christian Pauly 2022-05-30 09:24:26 +02:00
parent f3b8abd504
commit 9ace5d8375

View File

@ -59,6 +59,12 @@ class _QrScannerModalState extends State<QrScannerModal> {
void _onQRViewCreated(QRViewController controller) { void _onQRViewCreated(QRViewController controller) {
this.controller = controller; this.controller = controller;
// Workaround for QR Scanner is started in Pause mode
// https://github.com/juliuscanute/qr_code_scanner/issues/538#issuecomment-1133883828
if (Platform.isAndroid) {
controller.pauseCamera();
}
controller.resumeCamera();
late StreamSubscription sub; late StreamSubscription sub;
sub = controller.scannedDataStream.listen((scanData) { sub = controller.scannedDataStream.listen((scanData) {
sub.cancel(); sub.cancel();