formatting
Serhii committed
Jan 16, 2023 at 17:31 UTC
4636aacae71d511ae090e5f8d11bf75a9b602c39
1 file changed
+23
-29
lib/view_model/exchange/exchange_trade_view_model.dart
+23
-29
@@ -18,19 +18,18 @@ import 'package:cake_wallet/generated/i18n.dart';
18
19
part 'exchange_trade_view_model.g.dart';
20
21
-class ExchangeTradeViewModel = ExchangeTradeViewModelBase
22
- with _$ExchangeTradeViewModel;
21
+class ExchangeTradeViewModel = ExchangeTradeViewModelBase with _$ExchangeTradeViewModel;
22
23
abstract class ExchangeTradeViewModelBase with Store {
24
ExchangeTradeViewModelBase(
25
{required this.wallet,
27
- required this.trades,
28
- required this.tradesStore,
29
- required this.sendViewModel})
30
- : trade = tradesStore.trade!,
31
- isSendable = tradesStore.trade!.from == wallet.currency ||
32
- tradesStore.trade!.provider == ExchangeProviderDescription.xmrto,
33
- items = ObservableList<ExchangeTradeItem>() {
26
+ required this.trades,
27
+ required this.tradesStore,
28
+ required this.sendViewModel})
29
+ : trade = tradesStore.trade!,
30
+ isSendable = tradesStore.trade!.from == wallet.currency ||
31
+ tradesStore.trade!.provider == ExchangeProviderDescription.xmrto,
32
+ items = ObservableList<ExchangeTradeItem>() {
33
switch (trade.provider) {
34
case ExchangeProviderDescription.xmrto:
35
_provider = XMRTOExchangeProvider();
@@ -67,22 +66,20 @@ abstract class ExchangeTradeViewModelBase with Store {
66
67
@computed
68
String get extraInfo => trade.from == CryptoCurrency.xlm
70
- ? '\n\n' + S.current.xlm_extra_info
71
- : trade.from == CryptoCurrency.xrp
72
- ? '\n\n' + S.current.xrp_extra_info
73
- : '';
69
+ ? '\n\n' + S.current.xlm_extra_info
70
+ : trade.from == CryptoCurrency.xrp
71
+ ? '\n\n' + S.current.xrp_extra_info
72
+ : '';
73
74
@computed
76
- String get pendingTransactionFiatAmountValueFormatted =>
77
- sendViewModel.isFiatDisabled
78
- ? '' : sendViewModel.pendingTransactionFiatAmount
79
- + ' ' + sendViewModel.fiat.title;
75
+ String get pendingTransactionFiatAmountValueFormatted => sendViewModel.isFiatDisabled
76
+ ? ''
77
+ : sendViewModel.pendingTransactionFiatAmount + ' ' + sendViewModel.fiat.title;
78
79
@computed
82
- String get pendingTransactionFeeFiatAmountFormatted =>
83
- sendViewModel.isFiatDisabled
84
- ? '' : sendViewModel.pendingTransactionFeeFiatAmount
85
- + ' ' + sendViewModel.fiat.title;
80
+ String get pendingTransactionFeeFiatAmountFormatted => sendViewModel.isFiatDisabled
81
+ ? ''
82
+ : sendViewModel.pendingTransactionFeeFiatAmount + ' ' + sendViewModel.fiat.title;
83
84
@observable
85
ObservableList<ExchangeTradeItem> items;
@@ -130,18 +127,15 @@ abstract class ExchangeTradeViewModelBase with Store {
127
final title = trade.from == CryptoCurrency.xrp
128
? S.current.destination_tag
129
: trade.from == CryptoCurrency.xlm
133
- ? S.current.memo
134
- : S.current.extra_id;
130
+ ? S.current.memo
131
+ : S.current.extra_id;
132
136
- items.add(ExchangeTradeItem(
137
- title: title, data: '${trade.extraId}', isCopied: false));
133
+ items.add(ExchangeTradeItem(title: title, data: '${trade.extraId}', isCopied: false));
134
}
135
136
items.addAll([
141
- ExchangeTradeItem(
142
- title: S.current.amount, data: '${trade.amount}', isCopied: false),
143
- ExchangeTradeItem(
144
- title: S.current.status, data: '${trade.state}', isCopied: false),
137
+ ExchangeTradeItem(title: S.current.amount, data: '${trade.amount}', isCopied: false),
138
+ ExchangeTradeItem(title: S.current.status, data: '${trade.state}', isCopied: false),
139
ExchangeTradeItem(
140
title: S.current.send_to_this_address('${trade.from} ${trade.from.tag ?? ''}') + ':',
141
data: trade.inputAddress ?? '',