SunmiPrinterPlus class
A utility class for interacting with Sunmi printers and associated devices (e.g., LCD, drawer).
This class provides methods to manage printer operations, such as printing text, barcodes, QR codes, and images. It also includes functionalities for interacting with the device's LCD and drawer.
Constructors
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
-
addText(
{required List< SunmiText> sunmiTexts}) → Future<String?> - Adds multiple SunmiText objects to the print buffer.
-
configLCD(
{required SunmiLCDStatus status}) → Future< String?> -
Configures the LCD screen with a specified
status. -
cutPaper(
) → Future< String?> - Cuts the paper after printing.
-
getId(
) → Future< String?> - Retrieves the unique printer ID.
-
getPaper(
) → Future< String?> - Retrieves the paper status (e.g., paper out, paper loaded).
-
getPlatformVersion(
) → Future< String?> - Gets the platform version of the Sunmi Printer Plus device.
-
getStatus(
) → Future< String?> - Retrieves the current status of the printer.
-
getType(
) → Future< String?> - Retrieves the printer type.
-
getVersion(
) → Future< String?> - Retrieves the printer version.
-
isDrawerOpen(
) → Future< bool> - Checks if the drawer is currently open.
-
lcdImage(
{required Uint8List image}) → Future< String?> - Displays an image on the LCD screen.
-
line(
{String? type}) → Future< String?> -
Prints a line with an optional
type(e.g., solid or dashed). -
lineWrap(
{required int times}) → Future< String?> - Adds a specified number of blank lines to the print output.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openDrawer(
) → Future< String?> - Opens the drawer.
-
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 command data to the printer.
-
printImage(
Uint8List image, {required SunmiPrintAlign align}) → Future< String?> -
Prints an image with a specified
align(left, center, or right). -
printQrcode(
{required String text, SunmiQrcodeStyle? style}) → Future< String?> - Prints a QR code with optional SunmiQrcodeStyle.
-
printRow(
{required List< SunmiColumn> cols}) → Future<String?> - Prints a row of columns with specified text, width, and styles.
-
printText(
{required String text, SunmiTextStyle? style}) → Future< String?> - Prints plain text with an optional SunmiTextStyle.
-
printTSPL(
{required String data}) → Future< String?> - Sends raw TSPL command data to the printer.
-
rebindPrinter(
) → Future< bool> - Rebinds the printer service (useful if the service was killed or lost).
-
sendTextLCD(
{required String text, required int size, required bool fill}) → Future< String?> - Sends text to be displayed on the LCD screen.
-
showDigital(
String digital) → Future< String?> - Displays a digital value on the LCD screen.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited