align method

ESCPOS align(
  1. String align
)

Selects the alignment of the text

The alignment can be either "left", "center", or "right"

Returns the corresponding ESC POS command

Implementation

ESCPOS align(String align) {
  int num;
  switch (align) {
    case "center":
      num = 1;
      break;
    case "right":
      num = 2;
      break;
    case "left":
    default:
      num = 0;
      break;
  }
  _data += Uint8List.fromList([27, 97, num]);
  return this;
}