mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-21 06:18:42 +02:00
CAKE-15 | created header row, transaction page, balance view model, formatted item list, wallet balance; applied new design to trade and transaction rows; applied transaction page to dashboard page; applied balance view model, trade store, trade filter store and transaction filter store to dashboard view model; changed trade list item and transaction list item
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
enum ActionListDisplayMode { transactions, trades }
|
||||
|
||||
int serializeActionlistDisplayModes(List<ActionListDisplayMode> modes) {
|
||||
var i = 0;
|
||||
|
||||
for (final mode in modes) {
|
||||
switch (mode) {
|
||||
case ActionListDisplayMode.trades:
|
||||
i += 1;
|
||||
break;
|
||||
case ActionListDisplayMode.transactions:
|
||||
i += 10;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
List<ActionListDisplayMode> deserializeActionlistDisplayModes(int raw) {
|
||||
final modes = List<ActionListDisplayMode>();
|
||||
|
||||
if (raw == 1 || raw - 10 == 1) {
|
||||
modes.add(ActionListDisplayMode.trades);
|
||||
}
|
||||
|
||||
if (raw >= 10) {
|
||||
modes.add(ActionListDisplayMode.transactions);
|
||||
}
|
||||
|
||||
return modes;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
abstract class ActionListItem {
|
||||
DateTime get date;
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart';
|
||||
import 'package:cake_wallet/core/wallet_base.dart';
|
||||
import 'package:cake_wallet/monero/monero_wallet.dart';
|
||||
import 'package:cake_wallet/src/domain/common/balance_display_mode.dart';
|
||||
import 'package:cake_wallet/src/domain/common/calculate_fiat_amount.dart';
|
||||
import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/wallet_balance.dart';
|
||||
import 'package:cake_wallet/store/settings_store.dart';
|
||||
import 'package:cake_wallet/src/stores/price/price_store.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
|
||||
part 'balance_view_model.g.dart';
|
||||
|
||||
class BalanceViewModel = BalanceViewModelBase with _$BalanceViewModel;
|
||||
|
||||
abstract class BalanceViewModelBase with Store {
|
||||
BalanceViewModelBase({
|
||||
@required this.wallet,
|
||||
@required this.settingsStore,
|
||||
@required this.priceStore
|
||||
});
|
||||
|
||||
final WalletBase wallet;
|
||||
final SettingsStore settingsStore;
|
||||
final PriceStore priceStore;
|
||||
|
||||
WalletBalance _getWalletBalance() {
|
||||
final _wallet = wallet;
|
||||
|
||||
if (_wallet is MoneroWallet) {
|
||||
return WalletBalance(
|
||||
unlockedBalance: _wallet.balance.formattedUnlockedBalance,
|
||||
totalBalance: _wallet.balance.formattedFullBalance);
|
||||
}
|
||||
|
||||
if (_wallet is BitcoinWallet) {
|
||||
return WalletBalance(
|
||||
unlockedBalance: _wallet.balance.confirmedFormatted,
|
||||
totalBalance: _wallet.balance.unconfirmedFormatted);
|
||||
}
|
||||
}
|
||||
|
||||
String _getFiatBalance({double price, String cryptoAmount}) {
|
||||
if (cryptoAmount == null) {
|
||||
return '0.00';
|
||||
}
|
||||
|
||||
return calculateFiatAmount(price: price, cryptoAmount: cryptoAmount);
|
||||
}
|
||||
|
||||
@computed
|
||||
double get price {
|
||||
String symbol;
|
||||
final _wallet = wallet;
|
||||
|
||||
if (_wallet is MoneroWallet) {
|
||||
symbol = PriceStoreBase.generateSymbolForPair(
|
||||
fiat: settingsStore.fiatCurrency, crypto: CryptoCurrency.xmr);
|
||||
}
|
||||
|
||||
if (_wallet is BitcoinWallet) {
|
||||
symbol = PriceStoreBase.generateSymbolForPair(
|
||||
fiat: settingsStore.fiatCurrency, crypto: CryptoCurrency.btc);
|
||||
}
|
||||
|
||||
return priceStore.prices[symbol];
|
||||
}
|
||||
|
||||
@computed
|
||||
String get cryptoBalance {
|
||||
final walletBalance = _getWalletBalance();
|
||||
final displayMode = settingsStore.balanceDisplayMode;
|
||||
var balance = '---';
|
||||
|
||||
if (displayMode == BalanceDisplayMode.availableBalance) {
|
||||
balance = walletBalance.unlockedBalance ?? '0.0';
|
||||
}
|
||||
|
||||
if (displayMode == BalanceDisplayMode.fullBalance) {
|
||||
balance = walletBalance.totalBalance ?? '0.0';
|
||||
}
|
||||
|
||||
return balance;
|
||||
}
|
||||
|
||||
@computed
|
||||
String get fiatBalance {
|
||||
final walletBalance = _getWalletBalance();
|
||||
final displayMode = settingsStore.balanceDisplayMode;
|
||||
final fiatCurrency = settingsStore.fiatCurrency;
|
||||
var balance = '---';
|
||||
|
||||
final totalBalance = _getFiatBalance(
|
||||
price: price,
|
||||
cryptoAmount: walletBalance.totalBalance
|
||||
);
|
||||
|
||||
final unlockedBalance = _getFiatBalance(
|
||||
price: price,
|
||||
cryptoAmount: walletBalance.unlockedBalance
|
||||
);
|
||||
|
||||
if (displayMode == BalanceDisplayMode.availableBalance) {
|
||||
balance = fiatCurrency.toString() + ' ' + unlockedBalance ?? '0.00';
|
||||
}
|
||||
|
||||
if (displayMode == BalanceDisplayMode.fullBalance) {
|
||||
balance = fiatCurrency.toString() + ' ' + totalBalance ?? '0.00';
|
||||
}
|
||||
|
||||
return balance;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
import 'package:cake_wallet/bitcoin/bitcoin_transaction_info.dart';
|
||||
import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart';
|
||||
import 'package:cake_wallet/monero/monero_wallet.dart';
|
||||
import 'package:cake_wallet/src/domain/common/balance_display_mode.dart';
|
||||
import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
|
||||
import 'package:cake_wallet/src/domain/common/transaction_direction.dart';
|
||||
import 'package:cake_wallet/src/domain/common/transaction_info.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/trade.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/trade_list_item.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/transaction_list_item.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/action_list_item.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/action_list_display_mode.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/core/wallet_base.dart';
|
||||
import 'package:cake_wallet/src/domain/common/sync_status.dart';
|
||||
import 'package:cake_wallet/src/domain/common/wallet_type.dart';
|
||||
import 'package:cake_wallet/store/app_store.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/store/dashboard/trades_store.dart';
|
||||
import 'package:cake_wallet/store/dashboard/trade_filter_store.dart';
|
||||
import 'package:cake_wallet/store/dashboard/transaction_filter_store.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/formatted_item_list.dart';
|
||||
|
||||
part 'dashboard_view_model.g.dart';
|
||||
|
||||
class DashboardViewModel = DashboardViewModelBase with _$DashboardViewModel;
|
||||
|
||||
abstract class DashboardViewModelBase with Store {
|
||||
DashboardViewModelBase({
|
||||
this.balanceViewModel,
|
||||
this.appStore,
|
||||
this.tradesStore,
|
||||
this.tradeFilterStore,
|
||||
this.transactionFilterStore}) {
|
||||
|
||||
name = appStore.wallet?.name;
|
||||
wallet ??= appStore.wallet;
|
||||
type = wallet.type;
|
||||
|
||||
transactions = ObservableList.of(wallet.transactionHistory.transactions
|
||||
.map((transaction) => TransactionListItem(
|
||||
transaction: transaction,
|
||||
price: price,
|
||||
fiatCurrency: appStore.settingsStore.fiatCurrency,
|
||||
displayMode: balanceDisplayMode)));
|
||||
|
||||
_reaction = reaction((_) => appStore.wallet, _onWalletChange);
|
||||
|
||||
final _wallet = wallet;
|
||||
|
||||
if (_wallet is MoneroWallet) {
|
||||
subname = _wallet.account?.label;
|
||||
}
|
||||
|
||||
currentPage = 0;
|
||||
}
|
||||
|
||||
@observable
|
||||
WalletType type;
|
||||
|
||||
@observable
|
||||
String name;
|
||||
|
||||
@observable
|
||||
double currentPage;
|
||||
|
||||
@observable
|
||||
ObservableList<TransactionListItem> transactions;
|
||||
|
||||
@observable
|
||||
String subname;
|
||||
|
||||
@computed
|
||||
String get address => wallet.address;
|
||||
|
||||
@computed
|
||||
SyncStatus get status => wallet.syncStatus;
|
||||
|
||||
@computed
|
||||
String get syncStatusText {
|
||||
var statusText = '';
|
||||
|
||||
if (status is SyncingSyncStatus) {
|
||||
statusText = S.current
|
||||
.Blocks_remaining(
|
||||
status.toString());
|
||||
}
|
||||
|
||||
if (status is FailedSyncStatus) {
|
||||
statusText = S
|
||||
.current
|
||||
.please_try_to_connect_to_another_node;
|
||||
}
|
||||
|
||||
return statusText;
|
||||
}
|
||||
|
||||
@computed
|
||||
BalanceDisplayMode get balanceDisplayMode =>
|
||||
appStore.settingsStore.balanceDisplayMode;
|
||||
|
||||
@computed
|
||||
List<TradeListItem> get trades => tradesStore.trades;
|
||||
|
||||
@computed
|
||||
double get price => balanceViewModel.price;
|
||||
|
||||
@computed
|
||||
List<ActionListItem> get items {
|
||||
final _items = <ActionListItem>[];
|
||||
|
||||
_items
|
||||
.addAll(transactionFilterStore.filtered(transactions: transactions));
|
||||
_items.addAll(tradeFilterStore.filtered(trades: trades));
|
||||
|
||||
return formattedItemsList(_items);
|
||||
}
|
||||
|
||||
WalletBase wallet;
|
||||
|
||||
BalanceViewModel balanceViewModel;
|
||||
|
||||
AppStore appStore;
|
||||
|
||||
TradesStore tradesStore;
|
||||
|
||||
TradeFilterStore tradeFilterStore;
|
||||
|
||||
TransactionFilterStore transactionFilterStore;
|
||||
|
||||
ReactionDisposer _reaction;
|
||||
|
||||
void _onWalletChange(WalletBase wallet) {
|
||||
name = wallet.name;
|
||||
transactions.clear();
|
||||
transactions.addAll(wallet.transactionHistory.transactions
|
||||
.map((transaction) => TransactionListItem(
|
||||
transaction: transaction,
|
||||
price: price,
|
||||
fiatCurrency: appStore.settingsStore.fiatCurrency,
|
||||
displayMode: balanceDisplayMode)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import 'package:cake_wallet/view_model/dashboard/action_list_item.dart';
|
||||
|
||||
class DateSectionItem extends ActionListItem {
|
||||
DateSectionItem(this.date);
|
||||
|
||||
@override
|
||||
final DateTime date;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import 'package:cake_wallet/view_model/dashboard/action_list_item.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/date_section_item.dart';
|
||||
|
||||
List<ActionListItem> formattedItemsList(List<ActionListItem> items) {
|
||||
final formattedList = <ActionListItem>[];
|
||||
DateTime lastDate;
|
||||
items.sort((a, b) => b.date.compareTo(a.date));
|
||||
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
final transaction = items[i];
|
||||
|
||||
if (lastDate == null) {
|
||||
lastDate = transaction.date;
|
||||
formattedList.add(DateSectionItem(transaction.date));
|
||||
formattedList.add(transaction);
|
||||
continue;
|
||||
}
|
||||
|
||||
final isCurrentDay = lastDate.year == transaction.date.year &&
|
||||
lastDate.month == transaction.date.month &&
|
||||
lastDate.day == transaction.date.day;
|
||||
|
||||
if (isCurrentDay) {
|
||||
formattedList.add(transaction);
|
||||
continue;
|
||||
}
|
||||
|
||||
lastDate = transaction.date;
|
||||
formattedList.add(DateSectionItem(transaction.date));
|
||||
formattedList.add(transaction);
|
||||
}
|
||||
|
||||
return formattedList;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:cake_wallet/src/domain/exchange/trade.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/action_list_item.dart';
|
||||
import 'package:cake_wallet/src/domain/common/balance_display_mode.dart';
|
||||
|
||||
class TradeListItem extends ActionListItem {
|
||||
TradeListItem({this.trade, this.displayMode});
|
||||
|
||||
final Trade trade;
|
||||
final BalanceDisplayMode displayMode;
|
||||
|
||||
String get tradeFormattedAmount {
|
||||
return trade.amount != null
|
||||
? displayMode == BalanceDisplayMode.hiddenBalance
|
||||
? '---'
|
||||
: trade.amountFormatted()
|
||||
: trade.amount;
|
||||
}
|
||||
|
||||
@override
|
||||
DateTime get date => trade.createdAt;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import 'package:cake_wallet/src/domain/common/balance_display_mode.dart';
|
||||
import 'package:cake_wallet/src/domain/common/fiat_currency.dart';
|
||||
import 'package:cake_wallet/src/domain/common/transaction_info.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/action_list_item.dart';
|
||||
import 'package:cake_wallet/bitcoin/bitcoin_transaction_info.dart';
|
||||
import 'package:cake_wallet/src/domain/monero/monero_transaction_info.dart';
|
||||
import 'package:cake_wallet/src/domain/monero/monero_amount_format.dart';
|
||||
import 'package:cake_wallet/bitcoin/bitcoin_amount_format.dart';
|
||||
import 'package:cake_wallet/src/domain/common/calculate_fiat_amount_raw.dart';
|
||||
|
||||
class TransactionListItem extends ActionListItem {
|
||||
TransactionListItem({
|
||||
this.transaction,
|
||||
this.price,
|
||||
this.fiatCurrency,
|
||||
this.displayMode
|
||||
});
|
||||
|
||||
final TransactionInfo transaction;
|
||||
final double price;
|
||||
final FiatCurrency fiatCurrency;
|
||||
final BalanceDisplayMode displayMode;
|
||||
|
||||
String get formattedCryptoAmount {
|
||||
|
||||
return displayMode == BalanceDisplayMode.hiddenBalance
|
||||
? '---'
|
||||
: transaction.amountFormatted();
|
||||
}
|
||||
|
||||
String get formattedFiatAmount {
|
||||
|
||||
if (transaction is MoneroTransactionInfo) {
|
||||
final amount = calculateFiatAmountRaw(
|
||||
cryptoAmount: moneroAmountToDouble(amount: transaction.amount),
|
||||
price: price);
|
||||
transaction.changeFiatAmount(amount);
|
||||
}
|
||||
|
||||
if (transaction is BitcoinTransactionInfo) {
|
||||
final amount = calculateFiatAmountRaw(
|
||||
cryptoAmount: bitcoinAmountToDouble(amount: transaction.amount),
|
||||
price: price);
|
||||
transaction.changeFiatAmount(amount);
|
||||
}
|
||||
|
||||
return displayMode == BalanceDisplayMode.hiddenBalance
|
||||
? '---'
|
||||
: fiatCurrency.title + ' ' + transaction.fiatAmount();
|
||||
}
|
||||
|
||||
@override
|
||||
DateTime get date => transaction.date;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class WalletBalance {
|
||||
WalletBalance({this.unlockedBalance, this.totalBalance});
|
||||
|
||||
String unlockedBalance;
|
||||
String totalBalance;
|
||||
}
|
||||
@@ -1,194 +0,0 @@
|
||||
import 'package:cake_wallet/bitcoin/bitcoin_transaction_info.dart';
|
||||
import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart';
|
||||
import 'package:cake_wallet/monero/monero_wallet.dart';
|
||||
import 'package:cake_wallet/src/domain/common/transaction_direction.dart';
|
||||
import 'package:cake_wallet/src/domain/common/transaction_info.dart';
|
||||
import 'package:cake_wallet/src/stores/action_list/transaction_list_item.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/core/wallet_base.dart';
|
||||
import 'package:cake_wallet/src/domain/common/sync_status.dart';
|
||||
import 'package:cake_wallet/src/domain/common/wallet_type.dart';
|
||||
import 'package:cake_wallet/store/app_store.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
||||
part 'dashboard_view_model.g.dart';
|
||||
|
||||
class DashboardViewModel = DashboardViewModelBase with _$DashboardViewModel;
|
||||
|
||||
class WalletBalace {
|
||||
WalletBalace({this.unlockedBalance, this.totalBalance});
|
||||
|
||||
final String unlockedBalance;
|
||||
final String totalBalance;
|
||||
}
|
||||
|
||||
abstract class DashboardViewModelBase with Store {
|
||||
DashboardViewModelBase({this.appStore}) {
|
||||
name = appStore.wallet?.name;
|
||||
wallet ??= appStore.wallet;
|
||||
type = wallet.type;
|
||||
transactions = ObservableList.of(wallet.transactionHistory.transactions
|
||||
.map((transaction) => TransactionListItem(transaction: transaction)));
|
||||
_reaction = reaction((_) => appStore.wallet, _onWalletChange);
|
||||
|
||||
final _wallet = wallet;
|
||||
|
||||
if (_wallet is MoneroWallet) {
|
||||
subname = _wallet.account?.label;
|
||||
}
|
||||
|
||||
currentPage = 0;
|
||||
}
|
||||
|
||||
@observable
|
||||
WalletType type;
|
||||
|
||||
@observable
|
||||
String name;
|
||||
|
||||
@observable
|
||||
double currentPage;
|
||||
|
||||
@computed
|
||||
String get address => wallet.address;
|
||||
|
||||
@computed
|
||||
SyncStatus get status => wallet.syncStatus;
|
||||
|
||||
@computed
|
||||
String get syncStatusText {
|
||||
var statusText = '';
|
||||
|
||||
if (status is SyncingSyncStatus) {
|
||||
statusText = S.current
|
||||
.Blocks_remaining(
|
||||
status.toString());
|
||||
}
|
||||
|
||||
if (status is FailedSyncStatus) {
|
||||
statusText = S
|
||||
.current
|
||||
.please_try_to_connect_to_another_node;
|
||||
}
|
||||
|
||||
return statusText;
|
||||
}
|
||||
|
||||
@computed
|
||||
WalletBalace get balance {
|
||||
final wallet = this.wallet;
|
||||
|
||||
if (wallet is MoneroWallet) {
|
||||
return WalletBalace(
|
||||
unlockedBalance: wallet.balance.formattedUnlockedBalance,
|
||||
totalBalance: wallet.balance.formattedFullBalance);
|
||||
}
|
||||
|
||||
if (wallet is BitcoinWallet) {
|
||||
return WalletBalace(
|
||||
unlockedBalance: wallet.balance.confirmedFormatted,
|
||||
totalBalance: wallet.balance.unconfirmedFormatted);
|
||||
}
|
||||
}
|
||||
|
||||
@observable
|
||||
ObservableList<Object> transactions;
|
||||
// ObservableList.of([
|
||||
// TransactionListItem(transaction: BitcoinTransactionInfo(
|
||||
// id: '',
|
||||
// height: 0,
|
||||
// amount: 0,
|
||||
// direction: TransactionDirection.incoming,
|
||||
// date: DateTime.now(),
|
||||
// isPending: false
|
||||
// )),
|
||||
// TransactionListItem(transaction: BitcoinTransactionInfo(
|
||||
// id: '',
|
||||
// height: 0,
|
||||
// amount: 0,
|
||||
// direction: TransactionDirection.incoming,
|
||||
// date: DateTime.now(),
|
||||
// isPending: false
|
||||
// )),
|
||||
// TransactionListItem(transaction: BitcoinTransactionInfo(
|
||||
// id: '',
|
||||
// height: 0,
|
||||
// amount: 0,
|
||||
// direction: TransactionDirection.incoming,
|
||||
// date: DateTime.now(),
|
||||
// isPending: false
|
||||
// )),
|
||||
// TransactionListItem(transaction: BitcoinTransactionInfo(
|
||||
// id: '',
|
||||
// height: 0,
|
||||
// amount: 0,
|
||||
// direction: TransactionDirection.incoming,
|
||||
// date: DateTime.now(),
|
||||
// isPending: false
|
||||
// )),
|
||||
// TransactionListItem(transaction: BitcoinTransactionInfo(
|
||||
// id: '',
|
||||
// height: 0,
|
||||
// amount: 0,
|
||||
// direction: TransactionDirection.incoming,
|
||||
// date: DateTime.now(),
|
||||
// isPending: false
|
||||
// )),
|
||||
// TransactionListItem(transaction: BitcoinTransactionInfo(
|
||||
// id: '',
|
||||
// height: 0,
|
||||
// amount: 0,
|
||||
// direction: TransactionDirection.incoming,
|
||||
// date: DateTime.now(),
|
||||
// isPending: false
|
||||
// )),
|
||||
// TransactionListItem(transaction: BitcoinTransactionInfo(
|
||||
// id: '',
|
||||
// height: 0,
|
||||
// amount: 0,
|
||||
// direction: TransactionDirection.incoming,
|
||||
// date: DateTime.now(),
|
||||
// isPending: false
|
||||
// )),
|
||||
// TransactionListItem(transaction: BitcoinTransactionInfo(
|
||||
// id: '',
|
||||
// height: 0,
|
||||
// amount: 0,
|
||||
// direction: TransactionDirection.incoming,
|
||||
// date: DateTime.now(),
|
||||
// isPending: false
|
||||
// )),
|
||||
// TransactionListItem(transaction: BitcoinTransactionInfo(
|
||||
// id: '',
|
||||
// height: 0,
|
||||
// amount: 0,
|
||||
// direction: TransactionDirection.incoming,
|
||||
// date: DateTime.now(),
|
||||
// isPending: false
|
||||
// )),
|
||||
// TransactionListItem(transaction: BitcoinTransactionInfo(
|
||||
// id: '',
|
||||
// height: 0,
|
||||
// amount: 0,
|
||||
// direction: TransactionDirection.incoming,
|
||||
// date: DateTime.now(),
|
||||
// isPending: false
|
||||
// )),
|
||||
// ]);
|
||||
|
||||
@observable
|
||||
String subname;
|
||||
|
||||
WalletBase wallet;
|
||||
|
||||
AppStore appStore;
|
||||
|
||||
ReactionDisposer _reaction;
|
||||
|
||||
void _onWalletChange(WalletBase wallet) {
|
||||
name = wallet.name;
|
||||
transactions.clear();
|
||||
transactions.addAll(wallet.transactionHistory.transactions
|
||||
.map((transaction) => TransactionListItem(transaction: transaction)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user