easy_thermal_print library

Classes

BLEConfig
Configuration for Bluetooth Low Energy (BLE) communication.
BluetoothPrintersService
Printable
PrintConfig
Configuration for printing. labelSize specifies the size of the label to print on. printSpeed is the speed of the printer, default is 1. packetSize is the size of each packet sent to the printer, default is 64. halfTones indicates whether to use half-tones for printing, default is false. dryRun indicates whether to simulate the print job without sending data to the printer, default is false.
PrintData
PrintedViewer
A widget that displays the printed image from a ThermalPrinter. It listens to the printer's printed stream and updates the UI with the latest print data. The size parameter defines the size of the widget. The printer parameter is the thermal printer whose print data will be displayed. The widget will show the printed image if available, or an error message if there was an error during printing. If no print data is available yet, it will display a message indicating that.
PrinterModel
Represents a printer model with its properties and serialization method. The serialize function is used to convert the image data into a format suitable for printing. The bleConfig contains the necessary BLE service and characteristic UUIDs. The dpmm (dots per millimeter) is used to calculate the image size and is derived from the printer's DPI (dots per inch). The rotateImage flag indicates whether the image should be rotated before printing. The brand and deviceName provide identification for the printer model.
ThermalPrinter
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.

Constants

phomemoBLEConfig → const BLEConfig
presetTextStyle → const TextStyle

Properties

phomemoPrinters List<PrinterModel>
a list of presets for Phomemo printers.
final

Functions

imageFromText(String text, {Size? labelSize, TextStyle style = presetTextStyle}) Future<ImageData>
imageFromWidget(GlobalKey<State<StatefulWidget>> printableKey) Future<ImageData>
phomemoSerialize(PrinterModel self, ImageData image, PrintConfig config) PrintData

Typedefs

ImageData = Image
an alias for the image library's Image class