mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 12:09:43 +00:00
Merge pull request #123 from cake-tech/CAKE-120-xmr_to-exchange-description
CAKE-120 | added xmr.to exchange description to exchange and exchange…
This commit is contained in:
commit
8f1c543e8e
3 changed files with 21 additions and 3 deletions
|
@ -373,7 +373,9 @@ class ExchangePage extends BasePage {
|
|||
child: Observer(builder: (_) {
|
||||
final description =
|
||||
exchangeViewModel.provider is XMRTOExchangeProvider
|
||||
? exchangeViewModel.isReceiveAmountEntered
|
||||
? S.of(context).amount_is_guaranteed
|
||||
: S.of(context).amount_is_estimate
|
||||
: S.of(context).amount_is_estimate;
|
||||
return Center(
|
||||
child: Text(
|
||||
|
@ -433,6 +435,7 @@ class ExchangePage extends BasePage {
|
|||
exchangeViewModel.changeDepositAmount(amount: template.amount);
|
||||
exchangeViewModel.depositAddress = template.depositAddress;
|
||||
exchangeViewModel.receiveAddress = template.receiveAddress;
|
||||
exchangeViewModel.isReceiveAmountEntered = false;
|
||||
}
|
||||
|
||||
void _setReactions(
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:ui';
|
||||
import 'package:cake_wallet/exchange/exchange_provider.dart';
|
||||
import 'package:cake_wallet/exchange/exchange_template.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||
|
@ -169,7 +170,9 @@ class ExchangeTemplatePage extends BasePage {
|
|||
exchangeViewModel.wallet.currency
|
||||
? exchangeViewModel.wallet.address
|
||||
: exchangeViewModel.receiveAddress,
|
||||
initialIsAmountEditable: false,
|
||||
initialIsAmountEditable:
|
||||
exchangeViewModel.provider is
|
||||
XMRTOExchangeProvider ? true : false,
|
||||
initialIsAddressEditable:
|
||||
exchangeViewModel.isReceiveAddressEnabled,
|
||||
isAmountEstimated: true,
|
||||
|
@ -202,7 +205,9 @@ class ExchangeTemplatePage extends BasePage {
|
|||
child: Observer(builder: (_) {
|
||||
final description =
|
||||
exchangeViewModel.provider is XMRTOExchangeProvider
|
||||
? exchangeViewModel.isReceiveAmountEntered
|
||||
? S.of(context).amount_is_guaranteed
|
||||
: S.of(context).amount_is_estimate
|
||||
: S.of(context).amount_is_estimate;
|
||||
return Center(
|
||||
child: Text(
|
||||
|
@ -328,6 +333,12 @@ class ExchangeTemplatePage extends BasePage {
|
|||
receiveKey.currentState.isAddressEditable(isEditable: isEnabled);
|
||||
});
|
||||
|
||||
reaction((_) => exchangeViewModel.provider, (ExchangeProvider provider) {
|
||||
provider is XMRTOExchangeProvider
|
||||
? receiveKey.currentState.isAmountEditable(isEditable: true)
|
||||
: receiveKey.currentState.isAmountEditable(isEditable: false);
|
||||
});
|
||||
|
||||
/*reaction((_) => exchangeViewModel.limitsState, (LimitsState state) {
|
||||
String min;
|
||||
String max;
|
||||
|
@ -358,6 +369,7 @@ class ExchangeTemplatePage extends BasePage {
|
|||
if (depositAmountController.text != exchangeViewModel.depositAmount) {
|
||||
exchangeViewModel.changeDepositAmount(
|
||||
amount: depositAmountController.text);
|
||||
exchangeViewModel.isReceiveAmountEntered = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -368,6 +380,7 @@ class ExchangeTemplatePage extends BasePage {
|
|||
if (receiveAmountController.text != exchangeViewModel.receiveAmount) {
|
||||
exchangeViewModel.changeReceiveAmount(
|
||||
amount: receiveAmountController.text);
|
||||
exchangeViewModel.isReceiveAmountEntered = true;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -93,6 +93,7 @@ abstract class ExchangeViewModelBase with Store {
|
|||
@observable
|
||||
bool isReceiveAddressEnabled;
|
||||
|
||||
@observable
|
||||
bool isReceiveAmountEntered;
|
||||
|
||||
Limits limits;
|
||||
|
@ -256,6 +257,7 @@ abstract class ExchangeViewModelBase with Store {
|
|||
|
||||
@action
|
||||
void reset() {
|
||||
isReceiveAmountEntered = false;
|
||||
depositAmount = '';
|
||||
receiveAmount = '';
|
||||
depositCurrency = CryptoCurrency.xmr;
|
||||
|
|
Loading…
Reference in a new issue