updatePrinterSettings method

Future<PrinterStatus> updatePrinterSettings(
  1. Map<PrinterSettingItem, String> settings
)

Update printer settings. See Printer Configurations for available values. Some settings are not applied until the printer is restarted. Restart the printer, then confirm the values are properly applied via getPrinterSettings after the restart.

Implementation

Future<PrinterStatus> updatePrinterSettings(
    Map<PrinterSettingItem, String> settings) async {

  final Map<Map<String, dynamic>, String> dartSettings = settings.map((key, value) => new MapEntry(key.toMap(), value));
  var params = {
    "printerId": mPrinterId,
    "printInfo": mPrinterInfo.toMap(),
    "settings": dartSettings
  };

  final Map resultMap = await _channel.invokeMethod("updatePrinterSettings", params);
  PrinterStatus status = PrinterStatus.fromMap(resultMap);

  return status;
}