ThermalReceipt class

ThermalReceipt: wrapper + builder over esc_pos_utils_plus Generator

  • Holds bytes list
  • Keeps preview buffer in sync

Properties

hashCode int
The hash code for this object.
no setterinherited
paperSize → PaperSize
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build() List<int>
Final bytes for printing
col(String text, int width, {FontSize size = FontSize.normal, bool bold = false, PosAlign align = PosAlign.left}) → PosColumn
Helper to create PosColumn with mapped styles (so user doesn't need to import PosStyles)
colAuto(dynamic value, int width, {ReceiptTextType type = ReceiptTextType.text, FontSize size = FontSize.normal, bool bold = false, PosAlign align = PosAlign.left}) → PosColumn
cut() → void
cut paper
feed([int n = 1]) → void
feed n lines
hr([int width = 32]) → void
Convenience: horizontal rule
Insert image from asset (resize automatically) assetPath: path in assets, e.g. 'assets/logo.png' Replace existing logo(...) implementation with this one. Expects charsPerLine, _generator, _bytes, and _preview to exist in the class.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
note(String text) → void
preview() String
Text preview (human readable)
row(String left, String right, {bool bold = false, FontSize size = FontSize.normal}) → void
Convenience for common 2-column usage
rowColumns(List<PosColumn> columns) → void
Generic row that accepts PosColumn list (full control)
rowItem({required int qty, required String name, required num price, FontSize size = FontSize.normal}) → void
rowLabel(String label, String value, {FontSize size = FontSize.normal, bool bold = false}) → void
Smart row dengan alignment otomatis untuk tanda ":"
rowLabelCustom(String label, String value, {int labelWidth = 20, FontSize size = FontSize.normal, bool bold = false}) → void
Smart row dengan alignment untuk tanda ":" dengan custom width
text(String text, {FontSize size = FontSize.normal, bool bold = false, bool center = false}) → void
Generic text with logical font size + alignment
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create({PaperSize paper = PaperSize.mm58}) Future<ThermalReceipt>
factory: create generator by loading capability profile