mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-22 06:28:39 +02:00
Fixes for litecoin transactions. Change fixed rate mode for exchange.
This commit is contained in:
@@ -317,21 +317,6 @@ class ExchangePage extends BasePage {
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 12, left: 24),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
StandardCheckbox(
|
||||
key: checkBoxKey,
|
||||
value: exchangeViewModel.isFixedRateMode,
|
||||
caption: S.of(context).fixed_rate,
|
||||
onChanged: (value) =>
|
||||
exchangeViewModel.isFixedRateMode = value,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 30, left: 24, bottom: 24),
|
||||
child: Row(
|
||||
@@ -743,42 +728,15 @@ class ExchangePage extends BasePage {
|
||||
});
|
||||
|
||||
_receiveAmountFocus.addListener(() {
|
||||
if (_receiveAmountFocus.hasFocus && !exchangeViewModel.isFixedRateMode) {
|
||||
showPopUp<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertWithTwoActions(
|
||||
alertTitle: S.of(context).exchange,
|
||||
alertContent: S.of(context).fixed_rate_alert,
|
||||
leftButtonText: S.of(context).cancel,
|
||||
rightButtonText: S.of(context).ok,
|
||||
actionLeftButton: () {
|
||||
FocusScope.of(context).unfocus();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
actionRightButton: () {
|
||||
exchangeViewModel.isFixedRateMode = true;
|
||||
checkBoxKey.currentState
|
||||
.changeValue(exchangeViewModel.isFixedRateMode);
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
});
|
||||
}
|
||||
exchangeViewModel.isFixedRateMode = true;
|
||||
exchangeViewModel.changeReceiveAmount(
|
||||
amount: receiveAmountController.text);
|
||||
});
|
||||
|
||||
reaction((_) => exchangeViewModel.isFixedRateMode, (bool isFixedRateMode) {
|
||||
if ((_receiveAmountFocus.hasFocus ||
|
||||
exchangeViewModel.isReceiveAmountEntered) && !isFixedRateMode) {
|
||||
FocusScope.of(context).unfocus();
|
||||
receiveAmountController.text = '';
|
||||
} else {
|
||||
exchangeViewModel.changeDepositAmount(
|
||||
amount: depositAmountController.text);
|
||||
}
|
||||
|
||||
checkBoxKey.currentState
|
||||
.changeValue(exchangeViewModel.isFixedRateMode);
|
||||
exchangeViewModel.loadLimits();
|
||||
_depositAmountFocus.addListener(() {
|
||||
exchangeViewModel.isFixedRateMode = false;
|
||||
exchangeViewModel.changeDepositAmount(
|
||||
amount: depositAmountController.text);
|
||||
});
|
||||
|
||||
_isReactionsSet = true;
|
||||
|
||||
@@ -64,7 +64,7 @@ abstract class ExchangeViewModelBase with Store {
|
||||
loadLimits();
|
||||
reaction(
|
||||
(_) => isFixedRateMode,
|
||||
(Object _) => _defineIsReceiveAmountEditable());
|
||||
(Object _) => loadLimits());
|
||||
}
|
||||
|
||||
final WalletBase wallet;
|
||||
@@ -439,6 +439,6 @@ abstract class ExchangeViewModelBase with Store {
|
||||
isReceiveAmountEditable = false;
|
||||
}*/
|
||||
//isReceiveAmountEditable = false;
|
||||
isReceiveAmountEditable = (isFixedRateMode ?? false) && provider is ChangeNowExchangeProvider;
|
||||
isReceiveAmountEditable = provider is ChangeNowExchangeProvider;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user