writeBytes method
writeBytes let you write raw list int data into socket
Implementation
@override
Future<ConnectionResponse> writeBytes(List<int> data,
{bool isDisconnect: true}) async {
try {
if (!isConnected) {
await connect();
}
print(this.socket);
this.socket?.add(data);
if (isDisconnect) {
await disconnect();
}
return ConnectionResponse.success;
} catch (e) {
PosPrinterManager.logger.error("Error : $e");
return ConnectionResponse.printerNotConnected;
}
}