mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
[skip ci] change fiat api UI to swich mode
This commit is contained in:
parent
228e157b39
commit
37ca795756
2 changed files with 14 additions and 9 deletions
|
@ -24,14 +24,12 @@ class PrivacyPage extends BasePage {
|
|||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SettingsChoicesCell(
|
||||
ChoicesListItem<FiatApiMode>(
|
||||
SettingsSwitcherCell(
|
||||
title: S.current.fiat_api,
|
||||
items: FiatApiMode.all,
|
||||
selectedItem: _privacySettingsViewModel.fiatApiMode,
|
||||
onItemSelected: (FiatApiMode mode) => _privacySettingsViewModel.setFiatMode(mode),
|
||||
),
|
||||
),
|
||||
value: _privacySettingsViewModel.fiatApiMode,
|
||||
onValueChange: (BuildContext context, bool value) {
|
||||
_privacySettingsViewModel.setFiatMode(value);
|
||||
}),
|
||||
SettingsSwitcherCell(
|
||||
title: S.current.disable_exchange,
|
||||
value: _privacySettingsViewModel.disableExchange,
|
||||
|
|
|
@ -18,7 +18,7 @@ abstract class PrivacySettingsViewModelBase with Store {
|
|||
bool get shouldSaveRecipientAddress => _settingsStore.shouldSaveRecipientAddress;
|
||||
|
||||
@computed
|
||||
FiatApiMode get fiatApiMode => _settingsStore.fiatApiMode;
|
||||
bool get fiatApiMode => _settingsStore.fiatApiMode == FiatApiMode.disabled;
|
||||
|
||||
@action
|
||||
void setShouldSaveRecipientAddress(bool value) => _settingsStore.shouldSaveRecipientAddress = value;
|
||||
|
@ -27,5 +27,12 @@ abstract class PrivacySettingsViewModelBase with Store {
|
|||
void setEnableExchange(bool value) => _settingsStore.disableExchange = value;
|
||||
|
||||
@action
|
||||
void setFiatMode(FiatApiMode mode) => _settingsStore.fiatApiMode = mode;
|
||||
void setFiatMode(bool value) {
|
||||
if (value) {
|
||||
_settingsStore.fiatApiMode = FiatApiMode.disabled;
|
||||
return;
|
||||
}
|
||||
_settingsStore.fiatApiMode = FiatApiMode.enabled;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue