ThermalPrinter class

Represents a thermal printer with its properties and methods for printing. The deviceId is a unique identifier for the printer. The model is the printer model containing its specifications. The send function is used to send print data to the printer. The printed stream emits print data after a print job is completed.

Constructors

ThermalPrinter.new({required String deviceId, required PrinterModel model, required Future<void> send(List<int>)})

Properties

deviceId String
final
hashCode int
The hash code for this object.
no setterinherited
model PrinterModel
final
printed Stream<PrintData>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
send Future<void> Function(List<int>)
final

Methods

dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
print(ImageData image, PrintConfig config) Future<void>
printText(String text, PrintConfig config, {TextStyle style = presetTextStyle, TextAlign alignment = TextAlign.left, TextDirection textDirection = TextDirection.ltr}) Future<void>
Prints a text string using the provided config and style. The text is the content to be printed. The style defines the text style for printing.
printWidget(GlobalKey<State<StatefulWidget>> printableKey, PrintConfig config) Future<void>
Prints a widget identified by printableKey using the provided config. Make sure the widget is a Printable-Widget. Only this is able to extract the image data from the widget.
toString() String
A string representation of this object.
inherited

Operators

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