line method

Future<void> line({
  1. required int x,
  2. required int y,
  3. required int endX,
  4. required int endY,
  5. int width = 2,
})

Draw a line on the printer.

x and y are the coordinates of the start of the line. endX and endY are the coordinates of the end of the line. width is the width of the line. Defaults to 2. Range from 1 to 6.

Implementation

Future<void> line(
    {required int x,
    required int y,
    required int endX,
    required int endY,
    int width = 2}) async {
  Map<String, dynamic> params = {
    "x": x,
    "y": y,
    "endX": endX,
    "endY": endY,
    "width": width,
  };
  await methodChannel.invokeMethod<void>('line', params);
}