makeText method

  1. @override
Iterable<BarcodeElement> makeText(
  1. String data,
  2. double width,
  3. double height,
  4. double fontHeight,
  5. double textPadding,
  6. double lineWidth,
)
override

Implementation

@override
Iterable<BarcodeElement> makeText(
  String data,
  double width,
  double height,
  double fontHeight,
  double textPadding,
  double lineWidth,
) sync* {
  data = checkLength(data, maxLength);
  yield* super.makeText(
    data,
    width,
    height,
    fontHeight,
    textPadding,
    lineWidth,
  );

  if (drawIsbn) {
    final String isbn = "${data.substring(0, 3)}-${data.substring(3, 12)}-${data.substring(12, 13)}";

    yield BarcodeText(
      left: 0,
      top: 0,
      width: width,
      height: fontHeight,
      text: "ISBN $isbn",
      align: BarcodeTextAlign.center,
    );
  }
}