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)}'; } @override bool operator ==(Object other) => identical(this, other) || other is TabItem && id == other.id && tabId == other.tabId && productId == other.productId && productName == other.productName && quantity == other.quantity && unitPriceInCents == other.unitPriceInCents; @override int get hashCode => Object.hash( id, tabId, productId, productName, quantity, unitPriceInCents, ); }