Showing
2 changed files
with
4 additions
and
5 deletions
| @@ -8,7 +8,6 @@ Breaking changes: | @@ -8,7 +8,6 @@ Breaking changes: | ||
| 8 | * The `onPermissionSet` argument of the `MobileScannerController` is now deprecated. | 8 | * The `onPermissionSet` argument of the `MobileScannerController` is now deprecated. |
| 9 | To handle permission errors, consider catching the result of `MobileScannerController.start()`. | 9 | To handle permission errors, consider catching the result of `MobileScannerController.start()`. |
| 10 | * Toggling the device torch now does nothing if the device has no torch, rather than throwing an error. | 10 | * Toggling the device torch now does nothing if the device has no torch, rather than throwing an error. |
| 11 | -* The `onDetect` method of `MobileScanner` has been renamed to `onBarcodeDetected`. | ||
| 12 | * The `MobileScanner` widget no longer starts its `controller`. | 11 | * The `MobileScanner` widget no longer starts its `controller`. |
| 13 | Clients of the widget should call `controller.start()` when appropriate. | 12 | Clients of the widget should call `controller.start()` when appropriate. |
| 14 | * The `onStart` method has been renamed to `onScannerStarted`. | 13 | * The `onStart` method has been renamed to `onScannerStarted`. |
| @@ -18,8 +18,8 @@ class MobileScanner extends StatefulWidget { | @@ -18,8 +18,8 @@ class MobileScanner extends StatefulWidget { | ||
| 18 | /// Defaults to [BoxFit.cover]. | 18 | /// Defaults to [BoxFit.cover]. |
| 19 | final BoxFit fit; | 19 | final BoxFit fit; |
| 20 | 20 | ||
| 21 | - /// The function that signals when new barcodes were detected by the [controller]. | ||
| 22 | - final void Function(BarcodeCapture barcodes) onBarcodeDetected; | 21 | + /// The function that signals when new codes were detected by the [controller]. |
| 22 | + final void Function(BarcodeCapture barcodes) onDetect; | ||
| 23 | 23 | ||
| 24 | /// The function that signals when the barcode scanner is started. | 24 | /// The function that signals when the barcode scanner is started. |
| 25 | final void Function(MobileScannerArguments? arguments)? onScannerStarted; | 25 | final void Function(MobileScannerArguments? arguments)? onScannerStarted; |
| @@ -35,7 +35,7 @@ class MobileScanner extends StatefulWidget { | @@ -35,7 +35,7 @@ class MobileScanner extends StatefulWidget { | ||
| 35 | const MobileScanner({ | 35 | const MobileScanner({ |
| 36 | this.controller, | 36 | this.controller, |
| 37 | this.fit = BoxFit.cover, | 37 | this.fit = BoxFit.cover, |
| 38 | - required this.onBarcodeDetected, | 38 | + required this.onDetect, |
| 39 | this.onScannerStarted, | 39 | this.onScannerStarted, |
| 40 | this.placeholderBuilder, | 40 | this.placeholderBuilder, |
| 41 | super.key, | 41 | super.key, |
| @@ -86,7 +86,7 @@ class _MobileScannerState extends State<MobileScanner> | @@ -86,7 +86,7 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | _barcodesSubscription = _effectiveController.barcodes.listen( | 88 | _barcodesSubscription = _effectiveController.barcodes.listen( |
| 89 | - widget.onBarcodeDetected, | 89 | + widget.onDetect, |
| 90 | ); | 90 | ); |
| 91 | 91 | ||
| 92 | final internalController = _controller; | 92 | final internalController = _controller; |
-
Please register or login to post a comment