lineDot method
A line of dashes or any character
The function creates a string of the specified character repeated to the desired length, converts it to bytes, and appends a newline character. example :lineDot({int length = 13, String type = "-"})
Returns the resulting bytes
Implementation
ESCPOS lineDot({int length = 13, String type = "-"}) {
// Create a string of the specified character repeated to the desired length
String line = type * length;
// Convert the string to bytes
Uint8List lineBytes = strToBytes(line);
// Create bytes for a newline character
Uint8List newline = Uint8List.fromList([13, 10]);
// Merge the line bytes with newline bytes
_data += byteMerger(lineBytes, newline);
return this;
}