27 lines
626 B
Dart
27 lines
626 B
Dart
class TabItem {
|
|
final String id;
|
|
final String tabId;
|
|
final String productId;
|
|
final String productName;
|
|
final int quantity;
|
|
final int unitPriceInCents;
|
|
|
|
const TabItem({
|
|
required this.id,
|
|
required this.tabId,
|
|
required this.productId,
|
|
required this.productName,
|
|
required this.quantity,
|
|
required this.unitPriceInCents,
|
|
});
|
|
|
|
int get lineTotalInCents => quantity * unitPriceInCents;
|
|
|
|
String get formattedLineTotal {
|
|
return '€${(lineTotalInCents / 100).toStringAsFixed(2)}';
|
|
}
|
|
|
|
String get formattedUnitPrice {
|
|
return '€${(unitPriceInCents / 100).toStringAsFixed(2)}';
|
|
}
|
|
} |