printBarcode method
Prints a barcode label.
barcodeData – the data to encode.
x, y – label origin coordinates.
type – barcode symbology (0=Code39, 1=EAN-8, 2=UPC-E, 3=Code93,
4=Code128, 5=EAN-13).
orientation – rotation: N, R, I, or B.
height – bar height in dots.
f – 'Y' to show human-readable text, 'N' to hide it.
Implementation
Future<String?> printBarcode(
String barcodeData, {
String x = '10',
String y = '10',
int type = 4,
String orientation = 'N',
String height = '100',
String f = 'Y',
}) async {
try {
final String? result = await _channel.invokeMethod('printBarcode', {
'barcodeData': barcodeData,
'x': x,
'y': y,
'type': type,
'orientation': orientation,
'height': height,
'f': f,
});
return result;
} on PlatformException catch (e) {
throw 'Failed to print barcode: ${e.message}';
}
}