import 'package:flutter/foundation.dart'; import 'tab_item_purchase.dart'; class TabItem { final String id; final String tabId; final String productId; final String productName; final int quantity; final int unitPriceInCents; final List purchases; const TabItem({ required this.id, required this.tabId, required this.productId, required this.productName, required this.quantity, required this.unitPriceInCents, this.purchases = const [], }); int get lineTotalInCents => quantity * unitPriceInCents; @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 && listEquals(purchases, other.purchases); @override int get hashCode => Object.hash( id, tabId, productId, productName, quantity, unitPriceInCents, Object.hashAll(purchases), ); }