barcode method
Future<bool>
barcode(
- String content, {
- int x = 0,
- int y = 0,
- BarcodeType type = BarcodeType.Bc_128,
- int height = 40,
- HumanReadableAlignment humanReadable = HumanReadableAlignment.Center,
- TbRotation rotation = TbRotation.None,
- int narrowBarRatio = 2,
- int wideBarRatio = 2,
Defines a barcode. @param content Barcode content. @param x Starting point in the x direction defined in dots. @param y Starting point in the y direction defined in dots. @param type Type of barcode to make. @param humanReadable Alingment of the human readable text. @param rotation degrees of rotation. @param narrowBarRatio narrow bar ratio. @param wideBarRatio wide bar ratio.
Implementation
Future<bool> barcode(String content,
{int x = 0,
int y = 0,
BarcodeType type = BarcodeType.Bc_128,
int height = 40,
HumanReadableAlignment humanReadable = HumanReadableAlignment.Center,
TbRotation rotation = TbRotation.None,
int narrowBarRatio = 2,
int wideBarRatio = 2}) async {
var params = {
"printerId": _printerId,
"printInfo": _printerInfo.toMap(),
"content": content,
"x": x,
"y": y,
"type": type.getValue(),
"height": height,
"humanReadable": humanReadable.getValue(),
"rotation": rotation.getValue(),
"narrowBarRatio": narrowBarRatio,
"wideBarRatio": wideBarRatio
};
final bool success = await _channel.invokeMethod("typeB-barcode", params);
return success;
}