text method

void text(
  1. String text, {
  2. FontSize size = FontSize.normal,
  3. bool bold = false,
  4. bool center = false,
})

Generic text with logical font size + alignment

Implementation

void text(
  String text, {
  FontSize size = FontSize.normal,
  bool bold = false,
  bool center = false,
}) {
  final styles = ThermalFontMapper.style(
    size,
    bold: bold,
    align: center ? PosAlign.center : PosAlign.left,
  );

  _bytes.addAll(_generator.text(text, styles: styles));
  _preview.text(text, center: center);
}