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

Wrong output on scanning a barcode of format : GS1-128 (UCC/EAN-128) #322

Open
jineshpatel2002 opened this issue Jun 14, 2023 · 1 comment

Comments

@jineshpatel2002
Copy link

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;
});

}

@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 :
Screenshot 2023-06-14 200153

@Hectorc70
Copy link

Lo mismo, retorna una lectura incorrecta

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

No branches or pull requests

2 participants