mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 01:37:40 +00:00
CWA-169 | added MorphTokenExchangeProvider to dashboard page, trade filter store. Added morph icon to trade row
This commit is contained in:
parent
2373b06d52
commit
95222ecbae
3 changed files with 37 additions and 3 deletions
|
@ -480,7 +480,28 @@ class DashboardPageBodyState extends State<DashboardPageBody> {
|
||||||
ExchangeProviderDescription
|
ExchangeProviderDescription
|
||||||
.changeNow),
|
.changeNow),
|
||||||
)
|
)
|
||||||
])))
|
]))),
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 5,
|
||||||
|
child: Observer(
|
||||||
|
builder: (_) => Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text('MorphToken'),
|
||||||
|
Checkbox(
|
||||||
|
value: actionListStore
|
||||||
|
.tradeFilterStore
|
||||||
|
.displayMorphToken,
|
||||||
|
onChanged: (value) =>
|
||||||
|
actionListStore
|
||||||
|
.tradeFilterStore
|
||||||
|
.toggleDisplayExchange(
|
||||||
|
ExchangeProviderDescription
|
||||||
|
.morphToken),
|
||||||
|
)
|
||||||
|
])))
|
||||||
],
|
],
|
||||||
child: Text(S.of(context).filters,
|
child: Text(S.of(context).filters,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|
|
@ -82,6 +82,9 @@ class TradeRow extends StatelessWidget {
|
||||||
case ExchangeProviderDescription.changeNow:
|
case ExchangeProviderDescription.changeNow:
|
||||||
image = Image.asset('assets/images/change_now.png');
|
image = Image.asset('assets/images/change_now.png');
|
||||||
break;
|
break;
|
||||||
|
case ExchangeProviderDescription.morphToken:
|
||||||
|
image = Image.asset('assets/images/morph_icon.png');
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
image = null;
|
image = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ abstract class TradeFilterStoreBase with Store {
|
||||||
TradeFilterStoreBase(
|
TradeFilterStoreBase(
|
||||||
{this.displayXMRTO = true,
|
{this.displayXMRTO = true,
|
||||||
this.displayChangeNow = true,
|
this.displayChangeNow = true,
|
||||||
|
this.displayMorphToken = true,
|
||||||
this.walletStore});
|
this.walletStore});
|
||||||
|
|
||||||
@observable
|
@observable
|
||||||
|
@ -19,6 +20,9 @@ abstract class TradeFilterStoreBase with Store {
|
||||||
@observable
|
@observable
|
||||||
bool displayChangeNow;
|
bool displayChangeNow;
|
||||||
|
|
||||||
|
@observable
|
||||||
|
bool displayMorphToken;
|
||||||
|
|
||||||
WalletStore walletStore;
|
WalletStore walletStore;
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
@ -30,13 +34,16 @@ abstract class TradeFilterStoreBase with Store {
|
||||||
case ExchangeProviderDescription.xmrto:
|
case ExchangeProviderDescription.xmrto:
|
||||||
displayXMRTO = !displayXMRTO;
|
displayXMRTO = !displayXMRTO;
|
||||||
break;
|
break;
|
||||||
|
case ExchangeProviderDescription.morphToken:
|
||||||
|
displayMorphToken = !displayMorphToken;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TradeListItem> filtered({List<TradeListItem> trades}) {
|
List<TradeListItem> filtered({List<TradeListItem> trades}) {
|
||||||
final _trades =
|
final _trades =
|
||||||
trades.where((item) => item.trade.walletId == walletStore.id).toList();
|
trades.where((item) => item.trade.walletId == walletStore.id).toList();
|
||||||
final needToFilter = !displayChangeNow || !displayXMRTO;
|
final needToFilter = !displayChangeNow || !displayXMRTO || !displayMorphToken;
|
||||||
|
|
||||||
return needToFilter
|
return needToFilter
|
||||||
? trades
|
? trades
|
||||||
|
@ -45,7 +52,10 @@ abstract class TradeFilterStoreBase with Store {
|
||||||
item.trade.provider == ExchangeProviderDescription.xmrto) ||
|
item.trade.provider == ExchangeProviderDescription.xmrto) ||
|
||||||
(displayChangeNow &&
|
(displayChangeNow &&
|
||||||
item.trade.provider ==
|
item.trade.provider ==
|
||||||
ExchangeProviderDescription.changeNow))
|
ExchangeProviderDescription.changeNow) ||
|
||||||
|
(displayMorphToken &&
|
||||||
|
item.trade.provider ==
|
||||||
|
ExchangeProviderDescription.morphToken))
|
||||||
.toList()
|
.toList()
|
||||||
: _trades;
|
: _trades;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue