colAuto method
PosColumn
colAuto(
- dynamic value,
- int width, {
- ReceiptTextType type = ReceiptTextType.text,
- FontSize size = FontSize.normal,
- bool bold = false,
- PosAlign align = PosAlign.left,
Implementation
PosColumn colAuto(
dynamic value,
int width, {
ReceiptTextType type = ReceiptTextType.text,
FontSize size = FontSize.normal,
bool bold = false,
PosAlign align = PosAlign.left,
}) {
String text;
if (type == ReceiptTextType.money) {
if (value is num) {
text = formatMoney(value);
} else {
text = value.toString();
}
align = PosAlign.right; // money selalu kanan
} else {
text = value.toString();
}
return PosColumn(
text: text,
width: width,
styles: ThermalFontMapper.style(
size,
bold: bold,
align: align,
),
);
}