You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Future imprime() async {
final PaperSize paper = PaperSize.mm80;
final profile = await CapabilityProfile.load();
final printer = NetworkPrinter(paper, profile);
final PosPrintResult res = await printer.connect('10.0.0.168', port: 9100);
if (res == PosPrintResult.success) {
testReceipt(printer);
printer.disconnect();
}
print('Print result: ${res.msg}');
return res.msg;
I tried your example running in windows:
Future imprime() async {
final PaperSize paper = PaperSize.mm80;
final profile = await CapabilityProfile.load();
final printer = NetworkPrinter(paper, profile);
}
I get a "success" message but nothing is printed.
I then used this code, and it worked:
void printTicketViaLan(List bytes) async {
Duration timeout = const Duration(seconds: 5);
var result = await Socket.connect('10.0.0.168', 9100, timeout: timeout)
.then((Socket socket) {
socket.add(bytes);
socket.destroy();
return 'Data sent Success';
}).catchError((dynamic e) {
return 'Error sending Data';
});
debugPrint(result);
}
I really don't understand what is happening.
Could you advice.
The text was updated successfully, but these errors were encountered: