toMap method
Converts the SunmiBarcodeStyle object to a map for easy transfer or serialization.
The returned map contains the properties of the barcode style, which can be used to send the configuration to the printer or another system.
Returns a map with:
- 'size': The thickness of the barcode bars.
- 'height': The height of the barcode.
- 'textPos': The position of the text (string representation).
- 'type': The type of the barcode (string representation).
- 'align': The alignment of the barcode (string representation).
Implementation
Map<String, dynamic> toMap() {
return <String, dynamic>{
'size': size, // The thickness of the barcode bars.
'height': height, // The height of the barcode.
'textPos': textPos.name, // The position of the text.
'type': type.name, // The type of the barcode.
'align': align.name, // The alignment of the barcode.
};
}