class Balance { final String userId; final String userName; final double totalPaid; final double totalOwed; final double balance; Balance({ required this.userId, required this.userName, required this.totalPaid, required this.totalOwed, }) : balance = totalPaid - totalOwed; bool get shouldReceive => balance > 0; bool get shouldPay => balance < 0; double get absoluteBalance => balance.abs(); } class Settlement { final String fromUserId; final String fromUserName; final String toUserId; final String toUserName; final double amount; Settlement({ required this.fromUserId, required this.fromUserName, required this.toUserId, required this.toUserName, required this.amount, }); }