Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle errors in onDetect; exclude armv7 for iOS #1213

Merged

Conversation

navaronbracke
Copy link
Collaborator

Fixes #1209
Fixes #1210

target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.5.0'
end
target.build_configurations.each do |config|
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was badly indented

# Flutter.framework does not contain a i386 slice, and MLKit does not support armv7.
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 armv7',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added armv7 for both devices & simulators, per the MLKit docs. This should fix the reported build issue with IPA's.

_subscription = controller.barcodes.listen(widget.onDetect);
_subscription = controller.barcodes.listen(
widget.onDetect,
onError: widget.onDetectError,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were not handling errors from the stream when using on detect.

@@ -34,15 +35,17 @@ class MobileScanner extends StatefulWidget {
final MobileScannerController? controller;

/// The function that signals when new codes were detected by the [controller].
/// If null, use the controller.barcodes stream directly to capture barcodes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guidance is obsolete, as we now can handle errors in the case.

@navaronbracke navaronbracke merged commit dcf46c2 into juliansteenbakker:master Oct 11, 2024
5 checks passed
@navaronbracke navaronbracke deleted the onDetect_handle_error branch October 11, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onDetect does not handle barcode errors xArchive broken on iOS
1 participant