addLeftRightText method

void addLeftRightText(
  1. String leftText,
  2. String rightText, {
  3. ReceiptTextStyleType leftStyle = ReceiptTextStyleType.normal,
  4. ReceiptTextStyleType rightStyle = ReceiptTextStyleType.normal,
  5. ReceiptTextSizeType leftSize = ReceiptTextSizeType.medium,
  6. ReceiptTextSizeType rightSize = ReceiptTextSizeType.medium,
})

Handler tag of text (span or b) and put inside body html This will generate left right text with two value input from parameter leftText and rightText

Implementation

void addLeftRightText(
  String leftText,
  String rightText, {
  ReceiptTextStyleType leftStyle = ReceiptTextStyleType.normal,
  ReceiptTextStyleType rightStyle = ReceiptTextStyleType.normal,
  ReceiptTextSizeType leftSize = ReceiptTextSizeType.medium,
  ReceiptTextSizeType rightSize = ReceiptTextSizeType.medium,
}) {
  final ReceiptTextLeftRight leftRightText = ReceiptTextLeftRight(
    leftText,
    rightText,
    leftTextStyle: ReceiptTextStyle(
      type: leftStyle,
      useSpan: true,
      size: leftSize,
    ),
    rightTextStyle: ReceiptTextStyle(
      type: leftStyle,
      useSpan: true,
      size: rightSize,
    ),
  );
  _data += leftRightText.html;
}