mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +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
|
||||
.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,
|
||||
style: TextStyle(
|
||||
|
|
|
@ -82,6 +82,9 @@ class TradeRow extends StatelessWidget {
|
|||
case ExchangeProviderDescription.changeNow:
|
||||
image = Image.asset('assets/images/change_now.png');
|
||||
break;
|
||||
case ExchangeProviderDescription.morphToken:
|
||||
image = Image.asset('assets/images/morph_icon.png');
|
||||
break;
|
||||
default:
|
||||
image = null;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ abstract class TradeFilterStoreBase with Store {
|
|||
TradeFilterStoreBase(
|
||||
{this.displayXMRTO = true,
|
||||
this.displayChangeNow = true,
|
||||
this.displayMorphToken = true,
|
||||
this.walletStore});
|
||||
|
||||
@observable
|
||||
|
@ -19,6 +20,9 @@ abstract class TradeFilterStoreBase with Store {
|
|||
@observable
|
||||
bool displayChangeNow;
|
||||
|
||||
@observable
|
||||
bool displayMorphToken;
|
||||
|
||||
WalletStore walletStore;
|
||||
|
||||
@action
|
||||
|
@ -30,13 +34,16 @@ abstract class TradeFilterStoreBase with Store {
|
|||
case ExchangeProviderDescription.xmrto:
|
||||
displayXMRTO = !displayXMRTO;
|
||||
break;
|
||||
case ExchangeProviderDescription.morphToken:
|
||||
displayMorphToken = !displayMorphToken;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
List<TradeListItem> filtered({List<TradeListItem> trades}) {
|
||||
final _trades =
|
||||
trades.where((item) => item.trade.walletId == walletStore.id).toList();
|
||||
final needToFilter = !displayChangeNow || !displayXMRTO;
|
||||
final needToFilter = !displayChangeNow || !displayXMRTO || !displayMorphToken;
|
||||
|
||||
return needToFilter
|
||||
? trades
|
||||
|
@ -45,7 +52,10 @@ abstract class TradeFilterStoreBase with Store {
|
|||
item.trade.provider == ExchangeProviderDescription.xmrto) ||
|
||||
(displayChangeNow &&
|
||||
item.trade.provider ==
|
||||
ExchangeProviderDescription.changeNow))
|
||||
ExchangeProviderDescription.changeNow) ||
|
||||
(displayMorphToken &&
|
||||
item.trade.provider ==
|
||||
ExchangeProviderDescription.morphToken))
|
||||
.toList()
|
||||
: _trades;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue