getNetPrinters method

Future<List<NetPrinter>> getNetPrinters(
  1. List<String> modelName
)

Discover printers of the given model that are connected to the same network.

Implementation

Future<List<NetPrinter>> getNetPrinters(List<String> modelName) async {

  // TODO If on iOS don't call the platform, do it at the flutter layer.

  var params = {
    "printerId": mPrinterId,
    "printInfo": mPrinterInfo.toMap(),
    "models" : modelName,
  };

  final List<dynamic> resultList = await _channel.invokeMethod("getNetPrinters", params);

  final List<NetPrinter> outList = resultList.map( (netPrinter) => NetPrinter.fromMap(netPrinter)).toList();
  return outList;
}