convert method
Implementation
@override
Iterable<bool> convert(String data) sync* {
verify(data);
final String checksum = checkSumModulo10(data);
final int? pattern = BarcodeMaps.ean5Checksum[checksum.codeUnitAt(0)];
yield* add(BarcodeMaps.eanStartEan2, 5);
int index = 0;
for (final int code in data.codeUnits) {
final List<int>? codes = BarcodeMaps.ean[code];
if (codes == null) {
throw BarcodeException('Unable to encode "${String.fromCharCode(code)}" to $name Barcode');
}
if (index >= 1) {
yield* add(BarcodeMaps.eanCenterEan2, 2);
}
yield* add(codes[(pattern! >> index) & 1], 7);
index++;
}
}