printQRCode static method

Future<String?> printQRCode(
  1. String text, {
  2. SunmiQrcodeStyle? style,
})

Prints a QR code with optional SunmiQrcodeStyle.

text: The text for the QR code. style: The optional style for the QR code.

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

Implementation

static Future<String?> printQRCode(String text,
    {SunmiQrcodeStyle? style}) async {
  final printData = {
    "text": text,
    if (style != null) ...style.toMap(),
  };

  return await SunmiPrinterPlusPlatform.instance.printQrcode(printData);
}