printCustomText static method

Future<String?> printCustomText({
  1. required SunmiText sunmiText,
})

Prints custom text using a SunmiText object.

sunmiText: The text and style to print.

Returns a String indicating the result of the print operation, or null.

Implementation

static Future<String?> printCustomText({required SunmiText sunmiText}) async {
  final printData = {
    "text": sunmiText.text,
    if (sunmiText.style != null) ...sunmiText.style!.toMap(),
  };
  return await SunmiPrinterPlusPlatform.instance.printText(printData);
}