SunmiPrinterXPlus class

Main class for interacting with Sunmi printer

Constructors

SunmiPrinterXPlus()

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 Properties

isConnected Future<bool>
Check if printer is connected
no setter

Static Methods

commitLabelPrint({int copies = 1}) Future<bool>
Print the label with specified number of copies
drawBox({required int x, required int y, required int width, required int height}) Future<bool>
Draw a box on the label
init() Future<bool>
Initialize the printer
printBarCode({required String data, required int x, required int y, int width = 160, int height = 60, bool showText = true}) Future<bool>
Print a barcode on the label
printCustomLabel({required LabelConfig config, int copies = 1}) Future<bool>
打印自定义标签
printImage({required Uint8List image, required int x, required int y, required int width, required int height}) Future<bool>
Print an image on the label
printMultipleCustomLabels({required List<LabelConfig> configs}) Future<bool>
批量打印自定义标签
printProductLabel({required String productName, required String specification, required String code, required String unit, required String price, int copies = 1}) Future<bool>
Print a predefined product label (similar to printLabel2 in the demo)
printQRCode({required String data, required int x, required int y, int size = 120, QRCodeErrorCorrectionLevel errorCorrectionLevel = QRCodeErrorCorrectionLevel.medium}) Future<bool>
Print a QR code on the label
printText({required String text, required int x, required int y, int fontSize = 24, bool bold = false, int? width, int? height}) Future<bool>
Print text on the label
reset() Future<bool>
Reset the printer
startLabelPrint({required int width, required int height}) Future<bool>
Start a label printing session