Closed chukwumaokere closed 4 years ago
interesting, for me it adds a extra 0. hmm
Hi @chukwumaokere
I've checked the barcode, it is working fine. I've tested it on iPhone 8 plus (13.2.2)
.
One more thing,
sBarcode(someVal) async {
String bCode = await FlutterBarcodeScanner.scanBarcode("#ff6666", "Cancel", true);
print(bCode); -> What does it print?
someVal.enterBarcode(bCode);
return;
}
Here, in print statement what does it prints?
@chukwumaokere
I'm not able to reproduce this issue on both Android and iOS.
Are you still facing the same issue?
I've modified my code to add the leading zeroes programatically using javascript, since all my barcodes are always 8 digits long, so right now im not necessarily "having" the issue but It would exist if I removed my workaround
@chukwumaokere Can you post some sample code with which you are facing the issue so that I can try to reproduce this?
Im attaching it
This is a barcode type: Interleaved2of5 Whenever I scan this barcode I expect the result to be 00002463 but I'm getting "1331" as a result
Any ideas why? I've been trying to debug this You can even test here: https://www.barcodesinc.com/generator/image.php?code=00002463&style=453&type=I25&width=300&height=125&xres=2&font=3
Nevermind I've solved the error. Instead of doing this:
sBarcode(someVal) async {
String bCode = await FlutterBarcodeScanner.scanBarcode("#ff6666", "Cancel", true);
print(bCode);
someVal.enterBarcode(bCode);
return;
}
...
enterBarcode(barc) {
flutterWebViewPlugin.evalJavascript(`document.getElementById('barcodenumber').value="${barc}";`);
}
Do this
sBarcode(someVal) async {
String bCode = await FlutterBarcodeScanner.scanBarcode("#ff6666", "Cancel", true);
print(bCode);
someVal.enterBarcode(bCode);
return;
}
...
enterBarcode(barc) {
String js = "document.getElementById('barcodenumber').value='$barc'";
flutterWebViewPlugin.evalJavascript(js);
flutterWebViewPlugin.evalJavascript("document.getElementById('barcodenumber').dispatchEvent(event)");
}
Describe the bug Whenever I scan a barcode like this: The result that gets printed is only the digits after the leading zeroes.
To Reproduce Steps to reproduce the behavior:
Expected behavior When the barcode is scanned, the value should be 00002408, not 2408.
Smartphone (please complete the following information):
Additional context I take the value and I run these functions: