Problem when use zebrautility on flutter from pub.dev

Viewed 158

I recently add zebrautility: ^0.0.38 from https://pub.dev/packages/zebrautility to my flutter project. When i follow the steps on documentation i have the following error: enter image description here

I don't know why this happen, someone can help me?

1 Answers

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);
};
Related