printHeading static method

Future<bool> printHeading(
  1. String text, {
  2. double fontSize = 28,
  3. bool bold = true,
  4. int? printerWidth,
})

Print a heading (centered, larger text).

Convenience method for printing headings.

  • text: The heading text
  • fontSize: Font size in points
  • bold: Whether to use bold text
  • printerWidth: Printer width in dots

Returns true if printing was successful.

Implementation

static Future<bool> printHeading(
  String text, {
  double fontSize = 28,
  bool bold = true,
  int? printerWidth,
}) async {
  return await printCenteredText(
    text: text,
    fontSize: fontSize,
    fontWeight: bold ? FontWeight.bold : FontWeight.normal,
    printerWidth: printerWidth,
  );
}