printText method

void printText(
  1. String text, {
  2. String charset = "gbk",
  3. BoldMode? bold,
  4. UnderlineMode? underline,
  5. FontType? fontType,
  6. FontSize? fontSize,
  7. PrintAlignment? alignment,
})

Implementation

void printText(
  String text, {
  String charset = "gbk",
  BoldMode? bold,
  UnderlineMode? underline,
  FontType? fontType,
  FontSize? fontSize,
  PrintAlignment? alignment,
}) {
  _commands.addAll([
    if (alignment != null) SetPrintAlignment(alignment: alignment),
    if (bold != null) SetBold(mode: bold),
    if (underline != null) SetUnderline(mode: underline),
    if (fontType != null) SetFontType(fontType: fontType),
    if (fontSize != null) SetFontSize(fontSize: fontSize),
    PrintText(text: text, charset: charset),
  ]);
}