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: (_) {
|
child: Observer(builder: (_) {
|
||||||
final description =
|
final description =
|
||||||
exchangeViewModel.provider is XMRTOExchangeProvider
|
exchangeViewModel.provider is XMRTOExchangeProvider
|
||||||
? S.of(context).amount_is_guaranteed
|
? exchangeViewModel.isReceiveAmountEntered
|
||||||
|
? S.of(context).amount_is_guaranteed
|
||||||
|
: S.of(context).amount_is_estimate
|
||||||
: S.of(context).amount_is_estimate;
|
: S.of(context).amount_is_estimate;
|
||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -433,6 +435,7 @@ class ExchangePage extends BasePage {
|
||||||
exchangeViewModel.changeDepositAmount(amount: template.amount);
|
exchangeViewModel.changeDepositAmount(amount: template.amount);
|
||||||
exchangeViewModel.depositAddress = template.depositAddress;
|
exchangeViewModel.depositAddress = template.depositAddress;
|
||||||
exchangeViewModel.receiveAddress = template.receiveAddress;
|
exchangeViewModel.receiveAddress = template.receiveAddress;
|
||||||
|
exchangeViewModel.isReceiveAmountEntered = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _setReactions(
|
void _setReactions(
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
import 'package:cake_wallet/exchange/exchange_provider.dart';
|
||||||
import 'package:cake_wallet/exchange/exchange_template.dart';
|
import 'package:cake_wallet/exchange/exchange_template.dart';
|
||||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.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.currency
|
||||||
? exchangeViewModel.wallet.address
|
? exchangeViewModel.wallet.address
|
||||||
: exchangeViewModel.receiveAddress,
|
: exchangeViewModel.receiveAddress,
|
||||||
initialIsAmountEditable: false,
|
initialIsAmountEditable:
|
||||||
|
exchangeViewModel.provider is
|
||||||
|
XMRTOExchangeProvider ? true : false,
|
||||||
initialIsAddressEditable:
|
initialIsAddressEditable:
|
||||||
exchangeViewModel.isReceiveAddressEnabled,
|
exchangeViewModel.isReceiveAddressEnabled,
|
||||||
isAmountEstimated: true,
|
isAmountEstimated: true,
|
||||||
|
@ -202,7 +205,9 @@ class ExchangeTemplatePage extends BasePage {
|
||||||
child: Observer(builder: (_) {
|
child: Observer(builder: (_) {
|
||||||
final description =
|
final description =
|
||||||
exchangeViewModel.provider is XMRTOExchangeProvider
|
exchangeViewModel.provider is XMRTOExchangeProvider
|
||||||
? S.of(context).amount_is_guaranteed
|
? exchangeViewModel.isReceiveAmountEntered
|
||||||
|
? S.of(context).amount_is_guaranteed
|
||||||
|
: S.of(context).amount_is_estimate
|
||||||
: S.of(context).amount_is_estimate;
|
: S.of(context).amount_is_estimate;
|
||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -328,6 +333,12 @@ class ExchangeTemplatePage extends BasePage {
|
||||||
receiveKey.currentState.isAddressEditable(isEditable: isEnabled);
|
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) {
|
/*reaction((_) => exchangeViewModel.limitsState, (LimitsState state) {
|
||||||
String min;
|
String min;
|
||||||
String max;
|
String max;
|
||||||
|
@ -358,6 +369,7 @@ class ExchangeTemplatePage extends BasePage {
|
||||||
if (depositAmountController.text != exchangeViewModel.depositAmount) {
|
if (depositAmountController.text != exchangeViewModel.depositAmount) {
|
||||||
exchangeViewModel.changeDepositAmount(
|
exchangeViewModel.changeDepositAmount(
|
||||||
amount: depositAmountController.text);
|
amount: depositAmountController.text);
|
||||||
|
exchangeViewModel.isReceiveAmountEntered = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -368,6 +380,7 @@ class ExchangeTemplatePage extends BasePage {
|
||||||
if (receiveAmountController.text != exchangeViewModel.receiveAmount) {
|
if (receiveAmountController.text != exchangeViewModel.receiveAmount) {
|
||||||
exchangeViewModel.changeReceiveAmount(
|
exchangeViewModel.changeReceiveAmount(
|
||||||
amount: receiveAmountController.text);
|
amount: receiveAmountController.text);
|
||||||
|
exchangeViewModel.isReceiveAmountEntered = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,7 @@ abstract class ExchangeViewModelBase with Store {
|
||||||
@observable
|
@observable
|
||||||
bool isReceiveAddressEnabled;
|
bool isReceiveAddressEnabled;
|
||||||
|
|
||||||
|
@observable
|
||||||
bool isReceiveAmountEntered;
|
bool isReceiveAmountEntered;
|
||||||
|
|
||||||
Limits limits;
|
Limits limits;
|
||||||
|
@ -256,6 +257,7 @@ abstract class ExchangeViewModelBase with Store {
|
||||||
|
|
||||||
@action
|
@action
|
||||||
void reset() {
|
void reset() {
|
||||||
|
isReceiveAmountEntered = false;
|
||||||
depositAmount = '';
|
depositAmount = '';
|
||||||
receiveAmount = '';
|
receiveAmount = '';
|
||||||
depositCurrency = CryptoCurrency.xmr;
|
depositCurrency = CryptoCurrency.xmr;
|
||||||
|
|
Loading…
Reference in a new issue