printBarCode static method

Future<String?> printBarCode(
  1. String text, {
  2. SunmiBarcodeStyle? style,
})

Prints a barcode with optional SunmiBarcodeStyle.

text: The text for the barcode. style: The optional style for the barcode.

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

Implementation

static Future<String?> printBarCode(String text,
    {SunmiBarcodeStyle? style}) async {
  final printData = {
    "text": text,
    if (style != null) ...style.toMap(),
  };
  return await SunmiPrinterPlusPlatform.instance.printBarcode(printData);
}