mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 09:47:35 +00:00
formatting
This commit is contained in:
parent
b4249f21a9
commit
4636aacae7
1 changed files with 23 additions and 29 deletions
|
@ -18,19 +18,18 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||||
|
|
||||||
part 'exchange_trade_view_model.g.dart';
|
part 'exchange_trade_view_model.g.dart';
|
||||||
|
|
||||||
class ExchangeTradeViewModel = ExchangeTradeViewModelBase
|
class ExchangeTradeViewModel = ExchangeTradeViewModelBase with _$ExchangeTradeViewModel;
|
||||||
with _$ExchangeTradeViewModel;
|
|
||||||
|
|
||||||
abstract class ExchangeTradeViewModelBase with Store {
|
abstract class ExchangeTradeViewModelBase with Store {
|
||||||
ExchangeTradeViewModelBase(
|
ExchangeTradeViewModelBase(
|
||||||
{required this.wallet,
|
{required this.wallet,
|
||||||
required this.trades,
|
required this.trades,
|
||||||
required this.tradesStore,
|
required this.tradesStore,
|
||||||
required this.sendViewModel})
|
required this.sendViewModel})
|
||||||
: trade = tradesStore.trade!,
|
: trade = tradesStore.trade!,
|
||||||
isSendable = tradesStore.trade!.from == wallet.currency ||
|
isSendable = tradesStore.trade!.from == wallet.currency ||
|
||||||
tradesStore.trade!.provider == ExchangeProviderDescription.xmrto,
|
tradesStore.trade!.provider == ExchangeProviderDescription.xmrto,
|
||||||
items = ObservableList<ExchangeTradeItem>() {
|
items = ObservableList<ExchangeTradeItem>() {
|
||||||
switch (trade.provider) {
|
switch (trade.provider) {
|
||||||
case ExchangeProviderDescription.xmrto:
|
case ExchangeProviderDescription.xmrto:
|
||||||
_provider = XMRTOExchangeProvider();
|
_provider = XMRTOExchangeProvider();
|
||||||
|
@ -67,22 +66,20 @@ abstract class ExchangeTradeViewModelBase with Store {
|
||||||
|
|
||||||
@computed
|
@computed
|
||||||
String get extraInfo => trade.from == CryptoCurrency.xlm
|
String get extraInfo => trade.from == CryptoCurrency.xlm
|
||||||
? '\n\n' + S.current.xlm_extra_info
|
? '\n\n' + S.current.xlm_extra_info
|
||||||
: trade.from == CryptoCurrency.xrp
|
: trade.from == CryptoCurrency.xrp
|
||||||
? '\n\n' + S.current.xrp_extra_info
|
? '\n\n' + S.current.xrp_extra_info
|
||||||
: '';
|
: '';
|
||||||
|
|
||||||
@computed
|
@computed
|
||||||
String get pendingTransactionFiatAmountValueFormatted =>
|
String get pendingTransactionFiatAmountValueFormatted => sendViewModel.isFiatDisabled
|
||||||
sendViewModel.isFiatDisabled
|
? ''
|
||||||
? '' : sendViewModel.pendingTransactionFiatAmount
|
: sendViewModel.pendingTransactionFiatAmount + ' ' + sendViewModel.fiat.title;
|
||||||
+ ' ' + sendViewModel.fiat.title;
|
|
||||||
|
|
||||||
@computed
|
@computed
|
||||||
String get pendingTransactionFeeFiatAmountFormatted =>
|
String get pendingTransactionFeeFiatAmountFormatted => sendViewModel.isFiatDisabled
|
||||||
sendViewModel.isFiatDisabled
|
? ''
|
||||||
? '' : sendViewModel.pendingTransactionFeeFiatAmount
|
: sendViewModel.pendingTransactionFeeFiatAmount + ' ' + sendViewModel.fiat.title;
|
||||||
+ ' ' + sendViewModel.fiat.title;
|
|
||||||
|
|
||||||
@observable
|
@observable
|
||||||
ObservableList<ExchangeTradeItem> items;
|
ObservableList<ExchangeTradeItem> items;
|
||||||
|
@ -130,18 +127,15 @@ abstract class ExchangeTradeViewModelBase with Store {
|
||||||
final title = trade.from == CryptoCurrency.xrp
|
final title = trade.from == CryptoCurrency.xrp
|
||||||
? S.current.destination_tag
|
? S.current.destination_tag
|
||||||
: trade.from == CryptoCurrency.xlm
|
: trade.from == CryptoCurrency.xlm
|
||||||
? S.current.memo
|
? S.current.memo
|
||||||
: S.current.extra_id;
|
: S.current.extra_id;
|
||||||
|
|
||||||
items.add(ExchangeTradeItem(
|
items.add(ExchangeTradeItem(title: title, data: '${trade.extraId}', isCopied: false));
|
||||||
title: title, data: '${trade.extraId}', isCopied: false));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
items.addAll([
|
items.addAll([
|
||||||
ExchangeTradeItem(
|
ExchangeTradeItem(title: S.current.amount, data: '${trade.amount}', isCopied: false),
|
||||||
title: S.current.amount, data: '${trade.amount}', isCopied: false),
|
ExchangeTradeItem(title: S.current.status, data: '${trade.state}', isCopied: false),
|
||||||
ExchangeTradeItem(
|
|
||||||
title: S.current.status, data: '${trade.state}', isCopied: false),
|
|
||||||
ExchangeTradeItem(
|
ExchangeTradeItem(
|
||||||
title: S.current.send_to_this_address('${trade.from} ${trade.from.tag ?? ''}') + ':',
|
title: S.current.send_to_this_address('${trade.from} ${trade.from.tag ?? ''}') + ':',
|
||||||
data: trade.inputAddress ?? '',
|
data: trade.inputAddress ?? '',
|
||||||
|
|
Loading…
Reference in a new issue