makePrinterReady method

Future<bool?> makePrinterReady({
  1. bool beeper = true,
  2. bool drawer = false,
  3. bool cutter = true,
  4. int count = 1,
  5. PaperWidth width = PaperWidth.width58,
  6. ContentSize contentSize = ContentSize.small,
})

Implementation

Future<bool?> makePrinterReady({bool beeper = true, bool drawer = false, bool cutter = true, int count = 1, PaperWidth width = PaperWidth.width58, ContentSize contentSize = ContentSize.small}) {
  int paperWidth;
  switch(width) {
    case PaperWidth.width58:
      paperWidth = 384;
          break;
    case PaperWidth.width80:
      paperWidth = 576;
      break;
  }

  int content;
  switch(contentSize) {
    case ContentSize.small:
      content = 1;
      break;
    case ContentSize.medium:
      content = 2;
      break;
    case ContentSize.large:
      content = 3;
      break;
  }

  return CsnPrinterSdkPlatform.instance.makePrinterReady(
    beeper, drawer, cutter, count, paperWidth, content
  );
}