Description
When scanning certain barcodes, the scanner fails to detect them in portrait orientation. However, switching the phone to landscape orientation allows successful detection of the same barcodes.
Video Evidence
Video demonstration
Code Sample
String tempBarcodeValue = "-1";
String result = "-1";
await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => AiBarcodeScanner(
setPortraitOrientation: false,
galleryButtonType: GalleryButtonType.icon,
// Validate the scanned barcode
validator: (value) {
debugPrint("Barcode detected: ${value.barcodes.first.rawValue}");
return true;
},
onDetectError: (Object, StackTrace) {
debugPrint("Barcode detected error");
},
onDetect: (BarcodeCapture capture) {
// Handle the scanned barcode
debugPrint("Barcode detected: ${capture.barcodes.first.rawValue}");
result = capture.barcodes.first.rawValue ?? "-1";
if (result != tempBarcodeValue) {
Navigator.of(context).pop();
} else {
tempBarcodeValue = result;
}
},
),
),
);
Description
When scanning certain barcodes, the scanner fails to detect them in portrait orientation. However, switching the phone to landscape orientation allows successful detection of the same barcodes.
Video Evidence
Video demonstration
Code Sample