convert method
Implementation
@override
Iterable<bool> convert(String data) sync* {
final List<int> startStop = <int>[0x41, 0x42, 0x43, 0x44];
int lStart = startStop[start.index];
int lStop = startStop[stop.index];
if (explicitStartStop) {
lStart = _getStartStopByte(data.codeUnitAt(0));
lStop = _getStartStopByte(data.codeUnitAt(data.length - 1));
data = data.substring(1, data.length - 1);
}
yield* add(BarcodeMaps.codabar[lStart]!, BarcodeMaps.codabarLen[lStart]!);
yield false;
for (final int code in data.codeUnits) {
if (code > 0x40 || code == 0x2a) {
throw BarcodeException('Unable to encode "${String.fromCharCode(code)}" to $name Barcode');
}
final int? codeValue = BarcodeMaps.codabar[code];
if (codeValue == null) {
throw BarcodeException('Unable to encode "${String.fromCharCode(code)}" to $name Barcode');
}
final int codeLen = BarcodeMaps.codabarLen[code]!;
yield* add(codeValue, codeLen);
yield false;
}
yield* add(BarcodeMaps.codabar[lStop]!, BarcodeMaps.codabarLen[lStop]!);
}