CAKE-28 | created information page, exchange trade view model, exchange trade item; added trade property to trades store; changed filtered method (trade filter store); added tradesStore property to exchange view model; applied information page to exchange trade page

This commit is contained in:
Oleksandr Sobol
2020-08-26 20:31:23 +03:00
parent ecf7a5ba78
commit 76cde0530d
28 changed files with 344 additions and 111 deletions
+2 -5
View File
@@ -11,8 +11,7 @@ abstract class TradeFilterStoreBase with Store {
TradeFilterStoreBase(
{this.displayXMRTO = true,
this.displayChangeNow = true,
this.displayMorphToken = true,
this.wallet});
this.displayMorphToken = true});
@observable
bool displayXMRTO;
@@ -23,8 +22,6 @@ abstract class TradeFilterStoreBase with Store {
@observable
bool displayMorphToken;
WalletBase wallet;
@action
void toggleDisplayExchange(ExchangeProviderDescription provider) {
switch (provider) {
@@ -40,7 +37,7 @@ abstract class TradeFilterStoreBase with Store {
}
}
List<TradeListItem> filtered({List<TradeListItem> trades}) {
List<TradeListItem> filtered({List<TradeListItem> trades, WalletBase wallet}) {
final _trades =
trades.where((item) => item.trade.walletId == wallet.id).toList();
final needToFilter = !displayChangeNow || !displayXMRTO || !displayMorphToken;
+6
View File
@@ -27,6 +27,12 @@ abstract class TradesStoreBase with Store {
@observable
List<TradeListItem> trades;
@observable
Trade trade;
@action
void setTrade(Trade trade) => this.trade = trade;
@action
Future updateTradeList() async => trades =
tradesSource.values.map((trade) => TradeListItem(