Checkbox for fixed mode on exchange screen

This commit is contained in:
M 2022-02-03 15:49:34 +02:00
parent e326507b4d
commit 4923de4511

View file

@ -317,6 +317,21 @@ 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,
),
],
)
),
SizedBox(height: 30),
_buildTemplateSection(context)
],
@ -655,6 +670,12 @@ class ExchangePage extends BasePage {
}
});
reaction((_) => exchangeViewModel.isFixedRateMode, (bool value) {
if (checkBoxKey.currentState.value != exchangeViewModel.isFixedRateMode) {
checkBoxKey.currentState.value = exchangeViewModel.isFixedRateMode;
}
});
depositAddressController.addListener(
() => exchangeViewModel.depositAddress = depositAddressController.text);