Closed kw2019ltd closed 3 years ago
A version with this is available in the master branch.
use:
final BarcodeEan ean13 = Barcode.ean13();
final value = ean13.normalize('453987234345');
tested all fine except upce , example try to normalize 1234567 result should be 12345670 but failing with
print(Barcode.upcE().isValid("1234567")) -> print true print(barcodeEan.normalize("1234567")) - > failing below
BarcodeException: Unable to convert "1234567" to UPC E Barcode
I/flutter ( 6015): SEVERE: 2020-08-17 13:41:59.180170: #0 BarcodeUpcE.upcaToUpce (package:barcode/src/upce.dart:79:7)
I/flutter ( 6015): #1 BarcodeUpcE.normalize (package:barcode/src/upce.dart:370:14)
I/flutter ( 6015): #2 _EanTextEditingControllerWidgetState._createManualBarcodeDto (package:barcodeapp/widget/qr_barcode/create/ean_widget.dart:264:22)
I/flutter ( 6015): #3 _EanTextEditingControllerWidgetState._onPressed (package:barcodeapp/widget/qr_barcode/create/ean_widget.dart:222:19)
I/flutter ( 6015): #4 _EanTextEditingControllerWidgetState.build.
another example: 987456 when normalize it should be 09874565
print(Barcode.upcE().isValid("987456")) -> print true print(barcodeEan.normalize("987456")) - > failing below
Yes, you have to use the fallback:
print(Barcode.upcE(fallback: true).isValid("987456"))
i think iam missing something, for UPCE the code is 555555, and isValid return true.
now in barCodeWidget it display it as 05555550
but barcodeEan.normalize("555555") is failing on , why its not returning 05555550 ?
BarcodeException: Unable to convert "555555" to UPC E Barcode I/flutter ( 6015): SEVERE: 2020-08-17 13:41:59.180170: #0 BarcodeUpcE.upcaToUpce (package:barcode/src/upce.dart:79:7) I/flutter ( 6015): #1 BarcodeUpcE.normalize (package:barcode/src/upce.dart:370:14) I/flutter ( 6015): #2 _EanTextEditingControllerWidgetState._createManualBarcodeDto (package:barcodeapp/widget/qr_barcode/create/ean_widget.dart:264:22) I/flutter ( 6015): #3 _EanTextEditingControllerWidgetState._onPressed (package:barcodeapp/widget/qr_barcode/create/ean_widget.dart:222:19) I/flutter ( 6015): #4 _EanTextEditingControllerWidgetState.build. (package:barcodeapp/widget/qr_barcode/create/ean_widget.dart:177:31)
here the code is 555555 , and barcodeWidget works fine , but barcodeEan.normalize("555555") is failing
@kw2019ltd Here is a fix which should work as expected now.
now its working fine, can you release new ver
thanks.
Done. Don't hesitate to Buy Me A Coffee.
hi you create new ver in pub?
On Thu, Aug 20, 2020 at 12:06 AM David PHAM-VAN notifications@github.com wrote:
Done. Don't hesitate to Buy Me A Coffee https://www.buymeacoffee.com/JORBmbw9h .
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DavBfr/dart_barcode/issues/19#issuecomment-676703078, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALJEI6WHXNDUJDGFLIF7HRDSBQ5FTANCNFSM4QAJX7DA .
@kw2019ltd it's already updated: https://pub.dev/packages/barcode/changelog
Hi, can you expose method for ITF/EAN/UPC codes, input is barcode text and return barcode text + (checksum) if input text dose not contain checksum.