printSticker static method

Future<void> printSticker({
  1. required List<Uint8List> imageBytesList,
  2. required CupStickerSize size,
})

Implementation

static Future<void> printSticker({
  required List<Uint8List> imageBytesList,
  required CupStickerSize size,
}) async {
  final images = <Uint8List>[];

  for (final bytes in imageBytesList) {
    images.add(
      await resizeImage(
        imageBytes: bytes,
        size: size,
      ),
    );
  }

  final model = LabelModel(
    images: images,
    labelPerRow: LabelPerRow.single.copyWith(
      width: size.widthMm.toInt(),
      height: size.heightMm.toInt(),
      x: 0,
      y: 0,
    ),
  );
  await PrinterLabel.printLabel(
    barcodeImageModel: model,
  );
}