Skip to content

Commit e15333e

Browse files
Merge branch 'master' into develop
# Conflicts: # CHANGELOG.md # pubspec.yaml
2 parents f8749fb + 36a145f commit e15333e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ Known issues:
115115
* [Apple] The scan window does not work correctly.
116116
* [Apple] The camera flash briefly shows when the camera is started.
117117

118+
## 6.0.9
119+
Fixed onDetect not working when a `MobileScannerController` is provided.
120+
118121
## 6.0.8
119122
Improvements:
120123
* [Android] Remove the dependency on `org.jetbrains.kotlin:kotlin-bom`.

lib/src/mobile_scanner.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,16 @@ class _MobileScannerState extends State<MobileScanner>
288288

289289
if (widget.controller == null) {
290290
WidgetsBinding.instance.addObserver(this);
291+
}
292+
293+
if (widget.onDetect != null) {
291294
_subscription = controller.barcodes.listen(
292295
widget.onDetect,
293296
onError: widget.onDetectError,
294297
cancelOnError: false,
295298
);
296299
}
300+
297301
if (controller.autoStart) {
298302
await controller.start();
299303
}

0 commit comments

Comments
 (0)