printFile method

Future<PrinterStatus> printFile(
  1. String filepath
)

Print the image file or print data file (.prn) using print settings set by setPrinterInfo.

filepath The image (.jpg/.jpeg, .bmp, .png) file path or print data (.prn) path to be printed.

Implementation

Future<PrinterStatus> printFile(String filepath) async {
  var params = {
    "printerId": mPrinterId,
    "printInfo": mPrinterInfo.toMap(),
    "filePath" : filepath
  };

  final Map resultMap = await _channel.invokeMethod("printFile", params);
  print ("Received Result: $resultMap");

  PrinterStatus status = PrinterStatus.fromMap(resultMap);

  return status;
}