make method
Iterable<BarcodeElement>
make(
- String data, {
- required double width,
- required double height,
- bool drawText = false,
- double? fontHeight,
- double? textPadding,
override
Main method to produce the barcode graphic description. Returns a stream of drawing operations required to properly display the barcode as a UTF-8 string.
Use it with:
for (var op in Barcode.code39().make('HELLO', width: 200, height: 300)) {
print(op);
}
Implementation
@override
Iterable<BarcodeElement> make(
String data, {
required double width,
required double height,
bool drawText = false,
double? fontHeight,
double? textPadding,
}) {
final encoder = DataMatrixEncoder()..ascii(data);
return makeBytes(
encoder.toBytes(),
width: width,
height: height,
drawText: drawText,
fontHeight: fontHeight,
textPadding: textPadding,
);
}