From 4923de45112ad08fff00fa4f59e520f5090a24d3 Mon Sep 17 00:00:00 2001 From: M Date: Thu, 3 Feb 2022 15:49:34 +0200 Subject: [PATCH] Checkbox for fixed mode on exchange screen --- lib/src/screens/exchange/exchange_page.dart | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/src/screens/exchange/exchange_page.dart b/lib/src/screens/exchange/exchange_page.dart index d62713e1e..e16930e4f 100644 --- a/lib/src/screens/exchange/exchange_page.dart +++ b/lib/src/screens/exchange/exchange_page.dart @@ -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);