addText method

void addText(
  1. String text, {
  2. ReceiptAlignment alignment = ReceiptAlignment.center,
  3. ReceiptTextStyleType style = ReceiptTextStyleType.normal,
  4. ReceiptTextSizeType size = ReceiptTextSizeType.medium,
})

Handler tag of text (p or b) and put inside body html This will generate single line text left, center or right text value of text will print alignment to set alignment of text style define normal or bold size to set size of text small, medium, large or extra large

Implementation

void addText(
  String text, {
  ReceiptAlignment alignment = ReceiptAlignment.center,
  ReceiptTextStyleType style = ReceiptTextStyleType.normal,
  ReceiptTextSizeType size = ReceiptTextSizeType.medium,
}) {
  final ReceiptText receiptText = ReceiptText(
    text,
    textStyle: ReceiptTextStyle(
      type: style,
      size: size,
    ),
    alignment: alignment,
  );

  _data += receiptText.html;
}