MythiCode / zebra_utlity

MIT License
6 stars 26 forks source link

Error when the instance is created like on documentation #7

Closed alcampospalacios closed 3 years ago

alcampospalacios commented 3 years ago

The syntax error says Too many positional arguments : 0 expected, but 3 founds. Try removing the extra positional arguments, or specifyieng the name for named arguments. image

Now, when I do what the error message suggests I have another error like in the image below

image

alcampospalacios commented 3 years ago

Apparently the problem was that the parameters of the method. This is the way:

ZebraPrinter zebraPrinter = await Zebrautility.getPrinterInstance( onPrinterFound: onPrinterFound('hoid-connect', '192.168.43.80', true), onPrinterDiscoveryDone: onPrinterDiscoveryDone, onChangePrinterStatus: onChangePrinterStatus, onPermissionDenied: onPermissionDenied);

print(zebraPrinter);

zebraPrinter.connectToPrinter("192.168.43.80"); zebraPrinter.print(data); }

Function onPrinterFound = (String name, String ipAddress, bool isWifi) { print("PrinterFound :" + name + ipAddress); };

patelnirav48 commented 3 years ago

@alcampospalacios By seeing this it seems here we need to pass fixed ip address instead from discovered list? what if we need to display list of printers and by clicking on that it will connectToPrinter? How can we achieve that?

gmauro99 commented 2 years ago

Hello,

i've the same problem, I would to connect to device after discovered list is called, how can I do that?