PrinterModel class

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.

Constructors

PrinterModel.new({required String brand, required String deviceName, required double dpmm, bool rotateImage = false, required PrintData serialize(PrinterModel self, ImageData image, PrintConfig config), required BLEConfig bleConfig})
const
PrinterModel.phomemo({String brand = 'Phomemo', required String deviceName, bool rotateImage = false, required double dpmm, PrintData serialize(PrinterModel self, ImageData image, PrintConfig config) = phomemoSerialize, BLEConfig bleConfig = phomemoBLEConfig})
const

Properties

bleConfig BLEConfig
final
brand String
final
deviceName String
final
dpmm double
dots per millimeter. used to calculate the image size
FYI: dpi / 25.4 = dpmm
final
hashCode int
The hash code for this object.
no setterinherited
rotateImage bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serialize PrintData Function(PrinterModel self, ImageData image, PrintConfig config)
final

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