You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, and thanks for making this available. I wanted to switch to barcode_scan2 from the older flutter_barcode_scanner because our driver's licenses have the 15-digit license number in a small barcode above the detailed PDF417 barcode, and the older package has no way to restrict the format. Murphy's law says it will inevitably scan the wrong one.
But I have trouble: (only tested on Android 14 on Pixel phone so far) the preview area is so small (about 1/4 of the screen width) that I have to hold the license so far away that the camera seems to have trouble focusing, as it will not scan the detailed barcode at all. This does not seem to change with variations in the aspectTolerance (whose range of values and meanings could BTW stand an improvement in the docco, if anybody understands that and has a spare few minutes).
Code snippet:
var scanOpts = const ScanOptions(
restrictFormat: [BarcodeFormat.pdf417],
android: AndroidOptions(
aspectTolerance: 0.5,
useAutoFocus: true),
);
var result = await BarcodeScanner.scan(options: scanOpts);
if (!mounted) {
return;
}
if (result.type == ResultType.Cancelled) {
print("Cancelled");
return;
}
print(PDF417Decode.decode(result.rawContent));
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, and thanks for making this available. I wanted to switch to barcode_scan2 from the older flutter_barcode_scanner because our driver's licenses have the 15-digit license number in a small barcode above the detailed PDF417 barcode, and the older package has no way to restrict the format. Murphy's law says it will inevitably scan the wrong one.
But I have trouble: (only tested on Android 14 on Pixel phone so far) the preview area is so small (about 1/4 of the screen width) that I have to hold the license so far away that the camera seems to have trouble focusing, as it will not scan the detailed barcode at all. This does not seem to change with variations in the
aspectTolerance
(whose range of values and meanings could BTW stand an improvement in the docco, if anybody understands that and has a spare few minutes).Code snippet:
(The decode function is my own, creating a Person object based on just the set of fields I want extracted from the driver's license; much credit to https://www.reddit.com/r/ontario/comments/egtng6/what_personal_information_can_olg_get_from_your/).
A big TIA to anyone who can assist!
Beta Was this translation helpful? Give feedback.
All reactions