feat: product image and printer type

This commit is contained in:
efrilm
2025-08-03 01:00:33 +07:00
parent 39e3fdc81c
commit e1825fe86f
7 changed files with 108 additions and 93 deletions
+41 -41
View File
@@ -991,27 +991,27 @@ class PrintDataoutputs {
: '--------------------------------',
styles: const PosStyles(bold: false, align: PosAlign.center));
bytes += generator.feed(1);
// final kitchenProducts =
// products.where((p) => p.product.printerType == 'kitchen');
// for (final product in kitchenProducts) {
// bytes += generator.text('${product.quantity} x ${product.product.name}',
// styles: const PosStyles(
// align: PosAlign.left,
// bold: false,
// height: PosTextSize.size2,
// width: PosTextSize.size1,
// ));
// if (product.notes.isNotEmpty) {
// bytes += generator.text(' Notes: ${product.notes}',
// styles: const PosStyles(
// align: PosAlign.left,
// bold: false,
// height: PosTextSize.size1,
// width: PosTextSize.size1,
// fontType: PosFontType.fontA,
// ));
// }
// }
final kitchenProducts =
products.where((p) => p.product.printerType == 'kitchen');
for (final product in kitchenProducts) {
bytes += generator.text('${product.quantity} x ${product.product.name}',
styles: const PosStyles(
align: PosAlign.left,
bold: false,
height: PosTextSize.size2,
width: PosTextSize.size1,
));
if (product.notes.isNotEmpty) {
bytes += generator.text(' Notes: ${product.notes}',
styles: const PosStyles(
align: PosAlign.left,
bold: false,
height: PosTextSize.size1,
width: PosTextSize.size1,
fontType: PosFontType.fontA,
));
}
}
bytes += generator.feed(1);
bytes += generator.text(
@@ -1105,26 +1105,26 @@ class PrintDataoutputs {
: '--------------------------------',
styles: const PosStyles(bold: false, align: PosAlign.center));
bytes += generator.feed(1);
// final barProducts = products.where((p) => p.product.printerType == 'bar');
// for (final product in barProducts) {
// bytes += generator.text('${product.quantity} x ${product.product.name}',
// styles: const PosStyles(
// align: PosAlign.left,
// bold: false,
// height: PosTextSize.size2,
// width: PosTextSize.size1,
// ));
// if (product.notes.isNotEmpty) {
// bytes += generator.text(' Notes: ${product.notes}',
// styles: const PosStyles(
// align: PosAlign.left,
// bold: false,
// height: PosTextSize.size1,
// width: PosTextSize.size1,
// fontType: PosFontType.fontA,
// ));
// }
// }
final barProducts = products.where((p) => p.product.printerType == 'bar');
for (final product in barProducts) {
bytes += generator.text('${product.quantity} x ${product.product.name}',
styles: const PosStyles(
align: PosAlign.left,
bold: false,
height: PosTextSize.size2,
width: PosTextSize.size1,
));
if (product.notes.isNotEmpty) {
bytes += generator.text(' Notes: ${product.notes}',
styles: const PosStyles(
align: PosAlign.left,
bold: false,
height: PosTextSize.size1,
width: PosTextSize.size1,
fontType: PosFontType.fontA,
));
}
}
bytes += generator.feed(1);
bytes += generator.text(