Navaron Bracke

fix macos entitlements for example & use raw value for sample

... ... @@ -13,6 +13,7 @@ the sample recommends using `hasCameraPermission`, which also guards against cam
Bugs fixed:
* 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.
* [MacOS] Fixed a bug that prevented the `anaylzeImage()` sample from working properly.
## 5.2.3
... ...
... ... @@ -22,7 +22,14 @@ class _BarcodeScannerAnalyzeImageState
final XFile? file =
await ImagePicker().pickImage(source: ImageSource.gallery);
if (!mounted || file == null) {
if (!mounted) {
return;
}
if (file == null) {
setState(() {
_barcodeCapture = null;
});
return;
}
... ... @@ -43,7 +50,7 @@ class _BarcodeScannerAnalyzeImageState
if (_barcodeCapture != null) {
label = Text(
_barcodeCapture?.barcodes.firstOrNull?.displayValue ??
_barcodeCapture?.barcodes.firstOrNull?.rawValue ??
'No barcode detected',
);
}
... ...
... ... @@ -10,5 +10,7 @@
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>
... ...