addBarcode method Null safety

void addBarcode(
  1. {required int x,
  2. required int y,
  3. required String text,
  4. required int height,
  5. String barcodeType = barcodeCode128,
  6. int rotation = 0,
  7. int narrowUnit = 2,
  8. int widthUnit = 2,
  9. bool showHumanReadText = false}
)

添加条码 x 起点X坐标 y 起点Y坐标 text 内容 barcodeType 条码类型 height 条码高度 rotation 旋转角度 narrowUnit 窄条 widthUnit 宽条 showHumanReadText 显示文本

Implementation

void addBarcode(
    {required int x,
    required int y,
    required String text,
    required int height,
    String barcodeType = barcodeCode128,
    int rotation = 0,
    int narrowUnit = 2,
    int widthUnit = 2,
    bool showHumanReadText = false}) {
  addString(
      "BARCODE $x,$y,\"$barcodeType\",$height,${showHumanReadText ? 1 : 0},$rotation,$narrowUnit,$widthUnit,\"$text\"\r\n");
}