juliuscanute / qr_code_scanner

QR Code Scanner for Flutter
BSD 2-Clause "Simplified" License
1.01k stars 799 forks source link

Scanner reading a few times and stops reading #677

Open FelipeLemosBellini opened 1 year ago

FelipeLemosBellini commented 1 year ago

Scanner reading a few times and stops reading, so I have to close the screen and open it again, when removing the controller.dispose() this problem stops happening, it keeps reading several times. I'm using the mobile scanner to read a QrCode with the controller created as follows in my viewModel

MobileScannerController scanController = MobileScannerController(formats: [BarcodeFormat.qrCode]);

don't use dispose

@override void dispose() { scanController.dispose(); super.dispose(); }

mobile_scanner: ^3.2.0

Flutter 3.10.1 • Tools • Dart 3.0.1 • DevTools 2.23.1