Rqmco
Committed by GitHub

Fix: Fixes Issue #531

... ... @@ -116,6 +116,10 @@ class _MobileScannerState extends State<MobileScanner>
await Future.delayed(const Duration(seconds: 1, milliseconds: 500));
}
_barcodesSubscription ??= _controller.barcodes.listen(
widget.onDetect,
);
if (!_controller.autoStart) {
debugPrint(
'mobile_scanner: not starting automatically because autoStart is set to false in the controller.',
... ... @@ -123,10 +127,6 @@ class _MobileScannerState extends State<MobileScanner>
return;
}
_barcodesSubscription ??= _controller.barcodes.listen(
widget.onDetect,
);
_controller.start().then((arguments) {
// ignore: deprecated_member_use_from_same_package
widget.onStart?.call(arguments);
... ...