Files
hash-wallet/lib/view_model/dashboard/trade_list_item.dart
T
e5d99313eb Cw 498 improve wallet accounts (#1152)
* CW-498 Call updateTransactions on account change

* CW-498 Code Cleanup

* CW-498 Add Wallet Address to trade to match transactions to trades

* CW-498 Fix containsAddress to include only addresses of account

* Handle nullability for fromWalletAddress

---------

Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
2023-11-02 17:52:47 +02:00

20 lines
676 B
Dart

import 'package:cake_wallet/entities/balance_display_mode.dart';
import 'package:cake_wallet/exchange/trade.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/view_model/dashboard/action_list_item.dart';
class TradeListItem extends ActionListItem {
TradeListItem({required this.trade, required this.settingsStore});
final Trade trade;
final SettingsStore settingsStore;
BalanceDisplayMode get displayMode => settingsStore.balanceDisplayMode;
String get tradeFormattedAmount =>
displayMode == BalanceDisplayMode.hiddenBalance ? '---' : trade.amountFormatted();
@override
DateTime get date => trade.createdAt!;
}