fix macos entitlements for example & use raw value for sample
Showing
3 changed files
with
12 additions
and
2 deletions
| @@ -13,6 +13,7 @@ the sample recommends using `hasCameraPermission`, which also guards against cam | @@ -13,6 +13,7 @@ the sample recommends using `hasCameraPermission`, which also guards against cam | ||
| 13 | 13 | ||
| 14 | Bugs fixed: | 14 | Bugs fixed: |
| 15 | * Fixed a bug that would cause the scanner to emit an error when it was already started. Now it ignores any calls to start while it is starting. | 15 | * Fixed a bug that would cause the scanner to emit an error when it was already started. Now it ignores any calls to start while it is starting. |
| 16 | +* [MacOS] Fixed a bug that prevented the `anaylzeImage()` sample from working properly. | ||
| 16 | 17 | ||
| 17 | ## 5.2.3 | 18 | ## 5.2.3 |
| 18 | 19 |
| @@ -22,7 +22,14 @@ class _BarcodeScannerAnalyzeImageState | @@ -22,7 +22,14 @@ class _BarcodeScannerAnalyzeImageState | ||
| 22 | final XFile? file = | 22 | final XFile? file = |
| 23 | await ImagePicker().pickImage(source: ImageSource.gallery); | 23 | await ImagePicker().pickImage(source: ImageSource.gallery); |
| 24 | 24 | ||
| 25 | - if (!mounted || file == null) { | 25 | + if (!mounted) { |
| 26 | + return; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + if (file == null) { | ||
| 30 | + setState(() { | ||
| 31 | + _barcodeCapture = null; | ||
| 32 | + }); | ||
| 26 | return; | 33 | return; |
| 27 | } | 34 | } |
| 28 | 35 | ||
| @@ -43,7 +50,7 @@ class _BarcodeScannerAnalyzeImageState | @@ -43,7 +50,7 @@ class _BarcodeScannerAnalyzeImageState | ||
| 43 | 50 | ||
| 44 | if (_barcodeCapture != null) { | 51 | if (_barcodeCapture != null) { |
| 45 | label = Text( | 52 | label = Text( |
| 46 | - _barcodeCapture?.barcodes.firstOrNull?.displayValue ?? | 53 | + _barcodeCapture?.barcodes.firstOrNull?.rawValue ?? |
| 47 | 'No barcode detected', | 54 | 'No barcode detected', |
| 48 | ); | 55 | ); |
| 49 | } | 56 | } |
-
Please register or login to post a comment