Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to print multiple invoices ? #18

Open
nabil-ha opened this issue Mar 19, 2022 · 0 comments
Open

How to print multiple invoices ? #18

nabil-ha opened this issue Mar 19, 2022 · 0 comments

Comments

@nabil-ha
Copy link

nabil-ha commented Mar 19, 2022

Hi
I'm trying to print multiple invoices at the same time, I'm doing that by putting the code inside a block and then inside a for loop, but the results are the same line is printing repeatedly instead of the whole block being printed then the next loop and so on.

the code is:

for (int i = 0; i < amount; i++) {
    await _printInvoice();
  }



Future<void> _printInvoice(){
await SunmiPrinter.bindingPrinter();
  await SunmiPrinter.startTransactionPrint();
  await SunmiPrinter.setAlignment(SunmiPrintAlign.CENTER);
{the rest of the lines and texts}
await SunmiPrinter.cut();
  await SunmiPrinter.submitTransactionPrint();
  await SunmiPrinter.exitTransactionPrint();
  await Future.delayed(const Duration(seconds: 1), () {});
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant