make method

Iterable<BarcodeElement> make(
  1. String data, {
  2. required double width,
  3. required double height,
  4. bool drawText = false,
  5. double? fontHeight,
  6. double? textPadding,
})

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

Iterable<BarcodeElement> make(
  String data, {
  required double width,
  required double height,
  bool drawText = false,
  double? fontHeight,
  double? textPadding,
}) =>
    makeBytes(
      utf8.encoder.convert(data),
      width: width,
      height: height,
      drawText: drawText,
      fontHeight: fontHeight,
      textPadding: textPadding,
    );