DavBfr / dart_barcode

Barcode generation library
https://pub.dev/packages/barcode
Apache License 2.0
132 stars 41 forks source link

I can only generate barcodes for 7 of the supported types #45

Closed vanlooverenkoen closed 1 year ago

vanlooverenkoen commented 1 year ago

The code:

  Future<void> _getSvg(BarcodeType barcodeType) async {
    print('barcodeType: $barcodeType');
    Barcode barcode;
    switch (barcodeType) {
      case BarcodeType.code128:
        barcode = Barcode.code128();
        break;
      case BarcodeType.code39:
        barcode = Barcode.code39();
        break;
      case BarcodeType.code93:
        barcode = Barcode.code93();
        break;
      case BarcodeType.gs1_128:
        barcode = Barcode.gs128();
        break;
      case BarcodeType.itf:
        barcode = Barcode.itf();
        break;
      case BarcodeType.itf14:
        barcode = Barcode.itf14();
        break;
      case BarcodeType.itf16:
        barcode = Barcode.itf16();
        break;
      case BarcodeType.ean13:
        barcode = Barcode.ean13();
        break;
      case BarcodeType.ean8:
        barcode = Barcode.ean8();
        break;
      case BarcodeType.ean5:
        barcode = Barcode.ean5();
        break;
      case BarcodeType.ean2:
        barcode = Barcode.ean2();
        break;
      case BarcodeType.isbn:
        barcode = Barcode.isbn();
        break;
      case BarcodeType.upcA:
        barcode = Barcode.upcA();
        break;
      case BarcodeType.upcE:
        barcode = Barcode.upcE();
        break;
      case BarcodeType.telepen:
        barcode = Barcode.telepen();
        break;
      case BarcodeType.codabar:
        barcode = Barcode.codabar();
        break;
      case BarcodeType.qr:
        barcode = Barcode.qrCode();
        break;
      case BarcodeType.rm4scc:
        barcode = Barcode.rm4scc();
        break;
      case BarcodeType.pdf417:
        barcode = Barcode.pdf417();
        break;
      case BarcodeType.dataMatrix:
        barcode = Barcode.dataMatrix();
        break;
      case BarcodeType.aztec:
        barcode = Barcode.aztec();
        break;
      default:
        return;
    }

    final svg = barcode.toSvg('barcode', width: 200, height: 200);
    setState(() => this.svg = svg);
  }

enum BarcodeType {
  code128('code128'),
  code39('code39'),
  code93('code93'),
  gs1_128('gs1-128'),
  itf('itf'),
  itf14('itf14'),
  itf16('itf16'),
  ean13('ean13'),
  ean8('ean8'),
  ean5('ean5'),
  ean2('ean2'),
  isbn('isbn'),
  upcA('upcA'),
  upcE('upcE'),
  telepen('telepen'),
  codabar('codabar'),
  qr('qr'),
  rm4scc('rm4scc'),
  pdf417('pdf417'),
  dataMatrix('dataMatrix'),
  aztec('aztec');

  const BarcodeType(this.value);

  final String value;
}

Errors:

flutter: barcodeType: BarcodeType.qr
flutter: barcodeType: BarcodeType.qr
flutter: barcodeType: BarcodeType.code128
flutter: barcodeType: BarcodeType.code39
flutter: barcodeType: BarcodeType.code93
flutter: barcodeType: BarcodeType.gs1_128
flutter: barcodeType: BarcodeType.itf
flutter: barcodeType: BarcodeType.itf14
flutter: barcodeType: BarcodeType.itf16
flutter: barcodeType: BarcodeType.ean13
flutter: barcodeType: BarcodeType.ean8
flutter: barcodeType: BarcodeType.ean5
flutter: barcodeType: BarcodeType.ean2
flutter: barcodeType: BarcodeType.isbn
flutter: barcodeType: BarcodeType.upcA
flutter: barcodeType: BarcodeType.upcE
flutter: barcodeType: BarcodeType.telepen
flutter: barcodeType: BarcodeType.codabar
flutter: barcodeType: BarcodeType.rm4scc
flutter: barcodeType: BarcodeType.pdf417
flutter: barcodeType: BarcodeType.dataMatrix
flutter: barcodeType: BarcodeType.aztec
flutter:  09:19:10.078 ⛔ Zone error
flutter: 09:19:10.078 BarcodeException: Unable to encode "b" to CODE 39 Barcode
flutter:  09:19:10.078 #0   BarcodeCode39.convert (package:barcode/src/code39.dart:47:9)
flutter:  09:19:10.078 #1   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.078 #2   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.078 #3   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter:  09:19:10.078 #4   new List.of (dart:core-patch/array_patch.dart:51:28)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "b" to CODE 39 Barcode
flutter: 
#0      BarcodeCode39.convert (package:barcode/src/code39.dart:47:9)
#1      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#2      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#3      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#4      new List.of (dart:core-patch/array_patch.dart:51:28)
#5      Iterable.toList (dart:core/iterable.dart:470:12)
#6      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#7      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#8      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#9      Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#10     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#11     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#12     StatefulElement._firstBuild (package:flutter/src/widgets/fra<…>
flutter: ----------------------------------------------------
flutter:  09:19:10.087 ⛔ Zone error
flutter: 09:19:10.087 BarcodeException: Unable to encode "b" to CODE 93 Barcode
flutter:  09:19:10.087 #0   BarcodeCode93.convert (package:barcode/src/code93.dart:50:9)
flutter:  09:19:10.087 #1   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.087 #2   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.087 #3   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter:  09:19:10.087 #4   new List.of (dart:core-patch/array_patch.dart:51:28)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "b" to CODE 93 Barcode
flutter: 
#0      BarcodeCode93.convert (package:barcode/src/code93.dart:50:9)
#1      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#2      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#3      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#4      new List.of (dart:core-patch/array_patch.dart:51:28)
#5      Iterable.toList (dart:core/iterable.dart:470:12)
#6      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#7      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#8      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#9      Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#10     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#11     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#12     StatefulElement._firstBuild (package:flutter/src/widgets/fra<…>
flutter: ----------------------------------------------------
flutter:  09:19:10.097 ⛔ Zone error
flutter: 09:19:10.097 BarcodeException: ITF barcode can only encode an even number of digits.
flutter:  09:19:10.097 #0   BarcodeItf.convert (package:barcode/src/itf.dart:147:9)
flutter:  09:19:10.097 #1   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.097 #2   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.097 #3   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter:  09:19:10.097 #4   new List.of (dart:core-patch/array_patch.dart:51:28)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: ITF barcode can only encode an even number of digits.
flutter: 
#0      BarcodeItf.convert (package:barcode/src/itf.dart:147:9)
#1      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#2      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#3      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#4      new List.of (dart:core-patch/array_patch.dart:51:28)
#5      Iterable.toList (dart:core/iterable.dart:470:12)
#6      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#7      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#8      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#9      Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#10     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#11     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#12     StatefulElement._firstBuild (package:flutter/src/widgets/framewor<…>
flutter: ----------------------------------------------------
flutter:  09:19:10.105 ⛔ Zone error
flutter: 09:19:10.105 BarcodeException: Unable to encode "barcode" to ITF 14 Barcode, it is not 14 digits
flutter:  09:19:10.105 #0   BarcodeEan.checkLength (package:barcode/src/ean.dart:42:9)
flutter:  09:19:10.105 #1   BarcodeItf.convert (package:barcode/src/itf.dart:136:14)
flutter:  09:19:10.105 #2   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.105 #3   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.105 #4   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "barcode" to ITF 14 Barcode, it is not 14 digits
flutter: 
#0      BarcodeEan.checkLength (package:barcode/src/ean.dart:42:9)
#1      BarcodeItf.convert (package:barcode/src/itf.dart:136:14)
#2      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#3      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#4      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#5      new List.of (dart:core-patch/array_patch.dart:51:28)
#6      Iterable.toList (dart:core/iterable.dart:470:12)
#7      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#8      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#9      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#10     Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#11     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#12     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#13  <…>
flutter: ----------------------------------------------------
flutter:  09:19:10.114 ⛔ Zone error
flutter: 09:19:10.114 BarcodeException: Unable to encode "barcode" to ITF 16 Barcode, it is not 16 digits
flutter:  09:19:10.114 #0   BarcodeEan.checkLength (package:barcode/src/ean.dart:42:9)
flutter:  09:19:10.114 #1   BarcodeItf.convert (package:barcode/src/itf.dart:136:14)
flutter:  09:19:10.114 #2   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.114 #3   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.114 #4   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "barcode" to ITF 16 Barcode, it is not 16 digits
flutter: 
#0      BarcodeEan.checkLength (package:barcode/src/ean.dart:42:9)
#1      BarcodeItf.convert (package:barcode/src/itf.dart:136:14)
#2      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#3      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#4      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#5      new List.of (dart:core-patch/array_patch.dart:51:28)
#6      Iterable.toList (dart:core/iterable.dart:470:12)
#7      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#8      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#9      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#10     Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#11     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#12     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#13  <…>
flutter: ----------------------------------------------------
flutter:  09:19:10.123 ⛔ Zone error
flutter: 09:19:10.123 BarcodeException: Unable to encode "barcode" to EAN 13 Barcode, it is not 13 digits
flutter:  09:19:10.123 #0   BarcodeEan.checkLength (package:barcode/src/ean.dart:42:9)
flutter:  09:19:10.123 #1   BarcodeEan13.convert (package:barcode/src/ean13.dart:58:12)
flutter:  09:19:10.123 #2   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.123 #3   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.123 #4   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "barcode" to EAN 13 Barcode, it is not 13 digits
flutter: 
#0      BarcodeEan.checkLength (package:barcode/src/ean.dart:42:9)
#1      BarcodeEan13.convert (package:barcode/src/ean13.dart:58:12)
#2      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#3      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#4      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#5      new List.of (dart:core-patch/array_patch.dart:51:28)
#6      Iterable.toList (dart:core/iterable.dart:470:12)
#7      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#8      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#9      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#10     Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#11     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#12     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#1<…>
flutter: ----------------------------------------------------
flutter:  09:19:10.132 ⛔ Zone error
flutter: 09:19:10.132 BarcodeException: Unable to encode "b" to EAN 8 Barcode
flutter:  09:19:10.132 #0   BarcodeEan8.convert (package:barcode/src/ean8.dart:72:9)
flutter:  09:19:10.132 #1   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.132 #2   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.132 #3   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter:  09:19:10.132 #4   new List.of (dart:core-patch/array_patch.dart:51:28)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "b" to EAN 8 Barcode
flutter: 
#0      BarcodeEan8.convert (package:barcode/src/ean8.dart:72:9)
#1      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#2      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#3      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#4      new List.of (dart:core-patch/array_patch.dart:51:28)
#5      Iterable.toList (dart:core/iterable.dart:470:12)
#6      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#7      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#8      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#9      Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#10     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#11     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#12     StatefulElement._firstBuild (package:flutter/src/widgets/framewo<…>
flutter: ----------------------------------------------------
flutter:  09:19:10.144 ⛔ Zone error
flutter: 09:19:10.144 BarcodeException: Unable to encode "[98, 97, 114, 99, 111, 100, 101]", maximum length is 5 for EAN 5 Barcode
flutter:  09:19:10.144 #0   Barcode.verifyBytes (package:barcode/src/barcode.dart:531:7)
flutter:  09:19:10.144 #1   Barcode.verify (package:barcode/src/barcode.dart:524:31)
flutter:  09:19:10.144 #2   BarcodeEan5.convert (package:barcode/src/ean5.dart:56:5)
flutter:  09:19:10.144 #3   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.144 #4   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "[98, 97, 114, 99, 111, 100, 101]", maximum length is 5 for EAN 5 Barcode
flutter: 
#0      Barcode.verifyBytes (package:barcode/src/barcode.dart:531:7)
#1      Barcode.verify (package:barcode/src/barcode.dart:524:31)
#2      BarcodeEan5.convert (package:barcode/src/ean5.dart:56:5)
#3      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#4      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#5      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#6      new List.of (dart:core-patch/array_patch.dart:51:28)
#7      Iterable.toList (dart:core/iterable.dart:470:12)
#8      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#9      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#10     Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#11     Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#12     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#13     _CustomHtmlBarcodeState.initState (package:be_infor<…>
flutter: ----------------------------------------------------
flutter:  09:19:10.153 ⛔ Zone error
flutter: 09:19:10.153 BarcodeException: Unable to encode "[98, 97, 114, 99, 111, 100, 101]", maximum length is 2 for EAN 2 Barcode
flutter:  09:19:10.153 #0   Barcode.verifyBytes (package:barcode/src/barcode.dart:531:7)
flutter:  09:19:10.153 #1   Barcode.verify (package:barcode/src/barcode.dart:524:31)
flutter:  09:19:10.153 #2   BarcodeEan2.convert (package:barcode/src/ean2.dart:41:5)
flutter:  09:19:10.153 #3   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.153 #4   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "[98, 97, 114, 99, 111, 100, 101]", maximum length is 2 for EAN 2 Barcode
flutter: 
#0      Barcode.verifyBytes (package:barcode/src/barcode.dart:531:7)
#1      Barcode.verify (package:barcode/src/barcode.dart:524:31)
#2      BarcodeEan2.convert (package:barcode/src/ean2.dart:41:5)
#3      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#4      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#5      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#6      new List.of (dart:core-patch/array_patch.dart:51:28)
#7      Iterable.toList (dart:core/iterable.dart:470:12)
#8      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#9      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#10     Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#11     Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#12     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#13     _CustomHtmlBarcodeState.initState (package:be_infor<…>
flutter: ----------------------------------------------------
flutter:  09:19:10.161 ⛔ Zone error
flutter: 09:19:10.161 BarcodeException: Unable to encode "barcode" to ISBN Barcode, it is not 13 digits
flutter:  09:19:10.161 #0   BarcodeEan.checkLength (package:barcode/src/ean.dart:42:9)
flutter:  09:19:10.161 #1   BarcodeEan13.convert (package:barcode/src/ean13.dart:58:12)
flutter:  09:19:10.161 #2   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.161 #3   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.161 #4   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "barcode" to ISBN Barcode, it is not 13 digits
flutter: 
#0      BarcodeEan.checkLength (package:barcode/src/ean.dart:42:9)
#1      BarcodeEan13.convert (package:barcode/src/ean13.dart:58:12)
#2      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#3      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#4      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#5      new List.of (dart:core-patch/array_patch.dart:51:28)
#6      Iterable.toList (dart:core/iterable.dart:470:12)
#7      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#8      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#9      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#10     Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#11     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#12     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#1<…>
flutter: ----------------------------------------------------
flutter:  09:19:10.170 ⛔ Zone error
flutter: 09:19:10.170 BarcodeException: Unable to encode "barcode" to UPC A Barcode, it is not 12 digits
flutter:  09:19:10.170 #0   BarcodeEan.checkLength (package:barcode/src/ean.dart:42:9)
flutter:  09:19:10.170 #1   BarcodeUpcA.convert (package:barcode/src/upca.dart:53:12)
flutter:  09:19:10.170 #2   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.170 #3   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.170 #4   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "barcode" to UPC A Barcode, it is not 12 digits
flutter: 
#0      BarcodeEan.checkLength (package:barcode/src/ean.dart:42:9)
#1      BarcodeUpcA.convert (package:barcode/src/upca.dart:53:12)
#2      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#3      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#4      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#5      new List.of (dart:core-patch/array_patch.dart:51:28)
#6      Iterable.toList (dart:core/iterable.dart:470:12)
#7      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#8      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#9      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#10     Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#11     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#12     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#13 <…>
flutter: ----------------------------------------------------
flutter:  09:19:10.179 ⛔ Zone error
flutter: 09:19:10.179 BarcodeException: Unable to convert "barcode" to UPC A Barcode
flutter:  09:19:10.179 #0   BarcodeUpcE.upceToUpca (package:barcode/src/upce.dart:132:7)
flutter:  09:19:10.179 #1   BarcodeUpcE.convert (package:barcode/src/upce.dart:193:14)
flutter:  09:19:10.179 #2   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.179 #3   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.179 #4   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to convert "barcode" to UPC A Barcode
flutter: 
#0      BarcodeUpcE.upceToUpca (package:barcode/src/upce.dart:132:7)
#1      BarcodeUpcE.convert (package:barcode/src/upce.dart:193:14)
#2      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#3      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#4      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#5      new List.of (dart:core-patch/array_patch.dart:51:28)
#6      Iterable.toList (dart:core/iterable.dart:470:12)
#7      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#8      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#9      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#10     Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#11     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#12     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#<…>
flutter: ----------------------------------------------------
flutter:  09:19:10.188 ⛔ Zone error
flutter: 09:19:10.188 BarcodeException: Unable to encode "b" to CODABAR Barcode
flutter:  09:19:10.188 #0   BarcodeCodabar.convert (package:barcode/src/codabar.dart:95:9)
flutter:  09:19:10.188 #1   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.188 #2   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.188 #3   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter:  09:19:10.188 #4   new List.of (dart:core-patch/array_patch.dart:51:28)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "b" to CODABAR Barcode
flutter: 
#0      BarcodeCodabar.convert (package:barcode/src/codabar.dart:95:9)
#1      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#2      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#3      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#4      new List.of (dart:core-patch/array_patch.dart:51:28)
#5      Iterable.toList (dart:core/iterable.dart:470:12)
#6      Barcode1D.makeBytes (package:barcode/src/barcode_1d.dart:49:32)
#7      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#8      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#9      Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#10     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#11     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#12     StatefulElement._firstBuild (package:flutter/src/widgets/f<…>
flutter: ----------------------------------------------------
flutter:  09:19:10.196 ⛔ Zone error
flutter: 09:19:10.196 BarcodeException: Unable to encode "b" to RM4SCC
flutter:  09:19:10.196 #0   BarcodeRm4scc.convertHM (package:barcode/src/rm4scc.dart:47:9)
flutter:  09:19:10.196 #1   _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
flutter:  09:19:10.196 #2   new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
flutter:  09:19:10.196 #3   new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
flutter:  09:19:10.196 #4   new List.of (dart:core-patch/array_patch.dart:51:28)
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: BarcodeException: Unable to encode "b" to RM4SCC
flutter: 
#0      BarcodeRm4scc.convertHM (package:barcode/src/rm4scc.dart:47:9)
#1      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#2      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#3      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#4      new List.of (dart:core-patch/array_patch.dart:51:28)
#5      Iterable.toList (dart:core/iterable.dart:470:12)
#6      BarcodeHM.makeBytes (package:barcode/src/barcode_hm.dart:63:34)
#7      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:186:26)
#8      Barcode.toSvgBytes (package:barcode/src/barcode.dart:617:22)
#9      Barcode.toSvg (package:barcode/src/barcode.dart:580:7)
#10     _CustomHtmlBarcodeState._getSvg (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:127:25)
#11     _CustomHtmlBarcodeState.initState (package:be_informed_shared/widget/general/html/custom_html_barcode.dart:33:5)
#12     StatefulElement._firstBuild (package:flutter/src/widgets/f<…>
flutter: ----------------------------------------------------
vanlooverenkoen commented 1 year ago

It is because of the data some barcodes just do not support this text.