Closed FrenkyDema closed 2 years ago
void printText() {
SunmiPrinter.startTransactionPrint(true);
SunmiPrinter.printText("Test",
style: SunmiStyle(
fontSize: SunmiFontSize.XS,
bold: true,
align: SunmiPrintAlign.CENTER));
SunmiPrinter.exitTransactionPrint(true);
SunmiPrinter.line();
SunmiPrinter.lineWrap(2);
}
---------------------------------
Test
Test
is not bold, not align, not XS;
and is printed after the line and lineWrap
Are you using the V2s ? my other device was working very good
Are you using the V2s ? my other device was working very good
Yes, i'm on V2s
I tried with the new package update but obviously it didn't change the result. It appears as if styled printText calls are executed last, as if they were put on hold and executed last
ok I found the problem, that is, the lack of await
in front of the function, so the code after calling printText()
continued and did not wait for it to finish so that the printText
function was apparently executed last
void printText() {
SunmiPrinter.startTransactionPrint(true);
await SunmiPrinter.printText("Test", // there is the missing await
style: SunmiStyle(
fontSize: SunmiFontSize.XS,
bold: true,
align: SunmiPrintAlign.CENTER));
SunmiPrinter.exitTransactionPrint(true);
SunmiPrinter.line();
SunmiPrinter.lineWrap(2);
}
Test
---------------------------------
This code dosn't print the expected styled string but print only bold string