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
I am getting wrong output on scanning a barcode of above mentioned type(GS1-128 (UCC/EAN-128) ) on using this package to build my flutter application, but while other types like code-128, code-93 etc works perfectly fine.
I am attaching my main snippet of code , the output produced , desired output and barcode here.
Help me solve this issue...
code :
class _HomePageState extends State {
String? scanresult;
Future scanBarcode() async {
try {
scanresult = await FlutterBarcodeScanner.scanBarcode(
'#ff6666',
'Cancel',
true,
ScanMode.BARCODE,
);
if (scanresult == '-1') {
// User canceled the scan
print('Scan canceled');
scanresult = "Scan Cancelled";
} else {
// Handle the scanned barcode
print('Scanned Barcode: $scanresult');
//scanresult = 'Scanned Barcode: $scanresult';
// Do something with the barcode result
}
} on PlatformException catch (e) {
if (e.code == 'PERMISSION_NOT_GRANTED') {
print('Camera permission denied');
scanresult = ' Camera permission denied';
} else {
print('Error: $e');
scanresult = '$e';
}
} catch (e) {
print('Error: $e');
scanresult = '$e';
}
if(!mounted) return;
setState(() {
this.scanresult = scanresult;
});
I am getting wrong output on scanning a barcode of above mentioned type(GS1-128 (UCC/EAN-128) ) on using this package to build my flutter application, but while other types like code-128, code-93 etc works perfectly fine.
I am attaching my main snippet of code , the output produced , desired output and barcode here.
Help me solve this issue...
code :
class _HomePageState extends State {
String? scanresult;
Future scanBarcode() async {
}
@OverRide
void initState() {
super.initState();
}
return Scaffold(
.....
ElevatedButton(
onPressed: (){
scanBarcode();
},
)
.....
}
produced wrong output of scanResult : "]C1C-3184"
Correct output expected : "C-3184"
Image attached below :
The text was updated successfully, but these errors were encountered: