SunmiPrinter class

A utility class for interacting with the Sunmi printer.

Provides methods to print text, QR codes, barcodes, images, and more.

Properties

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

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

addText({required String text, SunmiTextStyle? style}) Future<String?>
Adds text to the print buffer with an optional SunmiTextStyle.
bindingPrinter() Future<bool?>
bindingPrinter the printer.
bold() Future<String?>
Set bold
cut() Future<String?>
Print escpos data.
cutPaper() Future<String?>
Cuts the paper.
exitTransactionPrint(bool trans) Future<String?>
exitTransactionPrint the printer.
initPrinter() Future<String?>
Initializes the printer.
line({String? type}) Future<String?>
Prints a line using an optional line type.
lineWrap(int times) Future<String?>
Adds a specified number of blank lines to the print output.
printBarCode(String text, {SunmiBarcodeStyle? style}) Future<String?>
Prints a barcode with optional SunmiBarcodeStyle.
printCustomText({required SunmiText sunmiText}) Future<String?>
Prints custom text using a SunmiText object.
printEscPos(List<int> data) Future<String?>
Sends raw ESC/POS commands to the printer.
printImage(Uint8List image, {SunmiPrintAlign align = SunmiPrintAlign.LEFT}) Future<String?>
Prints an image with a specified alignment.
printQRCode(String text, {SunmiQrcodeStyle? style}) Future<String?>
Prints a QR code with optional SunmiQrcodeStyle.
printRawData(Uint8List data) Future<String?>
Print escpos data.
printRow({required List<SunmiColumn> cols}) Future<String?>
Prints a row of columns with specified text, width, and styles.
printText(String text, {SunmiTextStyle? style}) Future<String?>
Prints plain text with an optional SunmiTextStyle.
printTSPL({required String data}) Future<String?>
Sends raw TSPL commands to the printer.
resetBold() Future<String?>
Reset bold
resetFontSize() Future<String?>
Reset font size
setAlignment(dynamic align) Future<String?>
Set alignment.
setCustomFontSize(int size) Future<String?>
Set custom font size.
setFontSize(dynamic size) Future<String?>
Set font size
startTransactionPrint(bool trans) Future<String?>
startTransaction the printer.