Hello,
I sometimes encounter an error when printing with sunmi_printer_plus, but not every time.
❌ Observed error
PlatformException(error, lateinit property sunmiPrinter has not been initialized, null, ...)
This happens when I try to print an image on a Sunmi printer.
🧾 Code used
Future<void> printTicket(Uint8List imageBytes) async {
await SunmiPrinter.bindingPrinter();
await SunmiPrinter.initPrinter();
final processed = _prepareForThermal(imageBytes);
await SunmiPrinter.printImage(
processed,
align: SunmiPrintAlign.CENTER,
);
await SunmiPrinter.cutPaper();
}
⚠️ Behavior
The issue is intermittent:
- sometimes printing works correctly
- sometimes I get the exception saying that sunmiPrinter has not been initialized
This looks like a timing or service binding issue.
📦 Version used
From my package_config.json:
{
"name": "sunmi_printer_plus",
"rootUri": ".../sunmi_printer_plus-4.1.1"
}
So I am definitely using version 4.1.1.
❓ Issue with rebindPrinter()
The 4.1.1 changelog mentions the addition of rebindPrinter().
However:
SunmiPrinter.rebindPrinter() does not exist in the Dart API
Dart reports:
The method 'rebindPrinter' isn't defined for the type 'SunmiPrinter'
I confirmed that my project is using version 4.1.1
👉 So there seems to be an inconsistency between the changelog and the actual published code.
❓ Questions
- What is now the recommended way to properly initialize the printer?
- Since bindingPrinter() and initPrinter() are deprecated, what should be used instead?
- Is rebindPrinter() actually available? If yes, how should it be used?
- Should we wait for an explicit “ready” state before printing?
- Do you have an up-to-date example of the recommended initialization flow?
📌 Context
- Sunmi device (Sunmi V3H)
- image printing
- intermittent issue
Thanks in advance.

Hello,
I sometimes encounter an error when printing with sunmi_printer_plus, but not every time.
❌ Observed error
PlatformException(error, lateinit property sunmiPrinter has not been initialized, null, ...)
This happens when I try to print an image on a Sunmi printer.
🧾 Code used
The issue is intermittent:
This looks like a timing or service binding issue.
📦 Version used
From my package_config.json:
So I am definitely using version 4.1.1.
❓ Issue with rebindPrinter()
The 4.1.1 changelog mentions the addition of rebindPrinter().
However:
SunmiPrinter.rebindPrinter() does not exist in the Dart API
Dart reports:
The method 'rebindPrinter' isn't defined for the type 'SunmiPrinter'
I confirmed that my project is using version 4.1.1
👉 So there seems to be an inconsistency between the changelog and the actual published code.
❓ Questions
📌 Context
Thanks in advance.