printESC method

  1. @override
Future<void> printESC({
  1. String? deviceId,
  2. PrinterConnectionType? connectionType,
  3. required PrintThermalModel printThermalModel,
})
override

Implementation

@override
Future<void> printESC({
  String? deviceId,
  PrinterConnectionType? connectionType,
  required PrintThermalModel printThermalModel,
}) async {
  final data = printThermalModel.toJson();
  if (deviceId != null) data["device_id"] = deviceId;
  if (connectionType != null) data["connection_type"] = connectionType.value;
  try {
    await _channel.invokeMethod(PrinterMethod.printImageEsc.value, data);
  } catch (e) {
    print("Error printing ESC: $e");
  }
}