printLabel method

  1. @override
Future<void> printLabel({
  1. String? deviceId,
  2. PrinterConnectionType? connectionType,
  3. required LabelModel labelModel,
})
override

Implementation

@override
Future<void> printLabel({
  String? deviceId,
  PrinterConnectionType? connectionType,
  required LabelModel labelModel,
}) async {
  final data = labelModel.toJson();
  if (deviceId != null) data["device_id"] = deviceId;
  if (connectionType != null) data["connection_type"] = connectionType.value;
  await _channel.invokeMethod(PrinterMethod.printLabel.value, data);
}