Fix Conflict with main

Rename classes to advanced privacy settings to avoid confusion between settings/privacy-settings
This commit is contained in:
OmarHatem 2022-12-04 05:08:42 +02:00
parent f792b58338
commit 9d64789983
21 changed files with 96 additions and 82 deletions

View file

@ -35,7 +35,7 @@ import 'package:cake_wallet/view_model/settings/display_settings_view_model.dart
import 'package:cake_wallet/view_model/settings/other_settings_view_model.dart';
import 'package:cake_wallet/view_model/settings/privacy_settings_view_model.dart';
import 'package:cake_wallet/view_model/settings/security_settings_view_model.dart';
import 'package:cake_wallet/view_model/privacy_settings_view_model.dart'
import 'package:cake_wallet/view_model/advanced_privacy_settings_view_model.dart';
import 'package:cw_core/unspent_coins_info.dart';
import 'package:cake_wallet/core/backup_service.dart';
import 'package:cw_core/wallet_service.dart';
@ -816,8 +816,8 @@ Future setup(
(IoniaAnyPayPaymentInfo paymentInfo, AnyPayPaymentCommittedInfo committedInfo)
=> IoniaPaymentStatusPage(getIt.get<IoniaPaymentStatusViewModel>(param1: paymentInfo, param2: committedInfo)));
getIt.registerFactoryParam<PrivacySettingsViewModel, WalletType, void>((type, _) =>
PrivacySettingsViewModel(type))
getIt.registerFactoryParam<AdvancedPrivacySettingsViewModel, WalletType, void>((type, _) =>
AdvancedPrivacySettingsViewModel(type, getIt.get<SettingsStore>()));
_isSetupFinished = true;
}

View file

@ -27,7 +27,7 @@ import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_details_page
import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_list_page.dart';
import 'package:cake_wallet/view_model/monero_account_list/account_list_item.dart';
import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart';
import 'package:cake_wallet/view_model/privacy_settings_view_model.dart';
import 'package:cake_wallet/view_model/advanced_privacy_settings_view_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/routes.dart';
@ -494,13 +494,14 @@ Route<dynamic> createRoute(RouteSettings settings) {
case Routes.onramperPage:
return CupertinoPageRoute<void>(builder: (_) => getIt.get<OnRamperPage>());
case Routes.privacySettings:
case Routes.advancedPrivacySettings:
final type = settings.arguments as WalletType;
final privacySettingsViewModel = getIt.get<PrivacySettingsViewModel>(param1: type);
final nodeCreateViewModel = getIt.get<NodeCreateOrEditViewModel>(param1: type);
return CupertinoPageRoute<void>(
builder: (_) => AdvancedPrivacySettingsPage(privacySettingsViewModel, nodeCreateViewModel));
builder: (_) => AdvancedPrivacySettingsPage(
getIt.get<AdvancedPrivacySettingsViewModel>(param1: type),
getIt.get<NodeCreateOrEditViewModel>(param1: type),
));
default:
return MaterialPageRoute<void>(

View file

@ -1,7 +1,7 @@
import 'package:cake_wallet/src/screens/nodes/widgets/node_form.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart';
import 'package:cake_wallet/view_model/privacy_settings_view_model.dart';
import 'package:cake_wallet/view_model/advanced_privacy_settings_view_model.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/generated/i18n.dart';
@ -12,7 +12,7 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
class AdvancedPrivacySettingsPage extends BasePage {
AdvancedPrivacySettingsPage(this.privacySettingsViewModel, this.nodeViewModel);
final PrivacySettingsViewModel privacySettingsViewModel;
final AdvancedPrivacySettingsViewModel privacySettingsViewModel;
final NodeCreateOrEditViewModel nodeViewModel;
@override
@ -27,7 +27,7 @@ class AdvancedPrivacySettingsBody extends StatefulWidget {
const AdvancedPrivacySettingsBody(this.privacySettingsViewModel, this.nodeViewModel, {Key? key})
: super(key: key);
final PrivacySettingsViewModel privacySettingsViewModel;
final AdvancedPrivacySettingsViewModel privacySettingsViewModel;
final NodeCreateOrEditViewModel nodeViewModel;
@override
@ -39,7 +39,7 @@ class _AdvancedPrivacySettingsBodyState
extends State<AdvancedPrivacySettingsBody> {
_AdvancedPrivacySettingsBodyState(this.privacySettingsViewModel, this.nodeViewModel);
final PrivacySettingsViewModel privacySettingsViewModel;
final AdvancedPrivacySettingsViewModel privacySettingsViewModel;
final NodeCreateOrEditViewModel nodeViewModel;
final _formKey = GlobalKey<FormState>();
@ -84,6 +84,7 @@ class _AdvancedPrivacySettingsBodyState
LoadingPrimaryButton(
onPressed: () {
nodeViewModel.save();
Navigator.pop(context);
},
text: S.of(context).continue_text,
color: Theme.of(context).accentTextTheme.bodyText1!.color!,

View file

@ -219,7 +219,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
GestureDetector(
onTap: () {
Navigator.of(context)
.pushNamed(Routes.privacySettings, arguments: _walletNewVM.type);
.pushNamed(Routes.advancedPrivacySettings, arguments: _walletNewVM.type);
},
child: Text(S.of(context).advanced_privacy_settings),
),

View file

@ -0,0 +1,51 @@
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/view_model/settings/switcher_list_item.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/generated/i18n.dart';
part 'advanced_privacy_settings_view_model.g.dart';
class AdvancedPrivacySettingsViewModel = AdvancedPrivacySettingsViewModelBase
with _$AdvancedPrivacySettingsViewModel;
abstract class AdvancedPrivacySettingsViewModelBase with Store {
AdvancedPrivacySettingsViewModelBase(this.type, this._settingsStore)
: _disableFiat = false,
_addCustomNode = false {
settings = [
// TODO: uncomment when Disable Fiat PR is merged
// SwitcherListItem(
// title: S.current.disable_fiat,
// value: () => _disableFiat,
// onValueChange: (_, bool value) => _disableFiat = value,
// ),
SwitcherListItem(
title: S.current.disable_exchange,
value: () => _settingsStore.disableExchange,
onValueChange: (_, bool value) {
_settingsStore.disableExchange = value;
},
),
SwitcherListItem(
title: S.current.add_custom_node,
value: () => _addCustomNode,
onValueChange: (_, bool value) => _addCustomNode = value,
),
];
}
late List<SwitcherListItem> settings;
@observable
bool _disableFiat = false;
@observable
bool _addCustomNode = false;
final WalletType type;
final SettingsStore _settingsStore;
@computed
bool get addCustomNode => _addCustomNode;
}

View file

@ -1,54 +0,0 @@
import 'package:cake_wallet/view_model/settings/switcher_list_item.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/generated/i18n.dart';
part 'privacy_settings_view_model.g.dart';
class PrivacySettingsViewModel = PrivacySettingsViewModelBase
with _$PrivacySettingsViewModel;
abstract class PrivacySettingsViewModelBase with Store {
PrivacySettingsViewModelBase(this.type)
: _disableFiat = false,
_disableExchange = false,
_addCustomNode = false {
settings = [
SwitcherListItem(
// TODO: replace when Disable Fiat PR is merged
title: "Disable Fiat API",
// title: S.current.disable_fiat,
value: () => _disableFiat,
onValueChange: (_, bool value) => _disableFiat = value,
),
SwitcherListItem(
title: "Disable Exchange",
// title: S.current.disable_exchange,
value: () => _disableExchange,
onValueChange: (_, bool value) => _disableExchange = value,
),
SwitcherListItem(
title: "Add New Custom Node",
// title: S.current.add_custom_node,
value: () => _addCustomNode,
onValueChange: (_, bool value) => _addCustomNode = value,
),
];
}
late List<SwitcherListItem> settings;
@observable
bool _disableFiat = false;
@observable
bool _disableExchange = false;
@observable
bool _addCustomNode = false;
final WalletType type;
@computed
bool get addCustomNode => _addCustomNode;
}

View file

@ -663,5 +663,6 @@
"other_settings": "Andere Einstellungen",
"disable_exchange": "Exchange deaktivieren",
"advanced_privacy_settings": "Erweiterte Datenschutzeinstellungen",
"settings_can_be_changed_later": "Diese Einstellungen können später in den App-Einstellungen geändert werden"
"settings_can_be_changed_later": "Diese Einstellungen können später in den App-Einstellungen geändert werden",
"add_custom_node": "Neuen benutzerdefinierten Knoten hinzufügen"
}

View file

@ -663,5 +663,6 @@
"other_settings": "Other settings",
"disable_exchange": "Disable exchange",
"advanced_privacy_settings": "Advanced Privacy Settings",
"settings_can_be_changed_later": "These settings can be changed later in the app settings"
"settings_can_be_changed_later": "These settings can be changed later in the app settings",
"add_custom_node": "Add New Custom Node"
}

View file

@ -663,5 +663,6 @@
"other_settings": "Otras configuraciones",
"disable_exchange": "Deshabilitar intercambio",
"advanced_privacy_settings": "Configuración avanzada de privacidad",
"settings_can_be_changed_later": "Estas configuraciones se pueden cambiar más tarde en la configuración de la aplicación"
"settings_can_be_changed_later": "Estas configuraciones se pueden cambiar más tarde en la configuración de la aplicación",
"add_custom_node": "Agregar nuevo nodo personalizado"
}

View file

@ -661,5 +661,6 @@
"other_settings": "Autres paramètres",
"disable_exchange": "Désactiver l'échange",
"advanced_privacy_settings": "Paramètres de confidentialité avancés",
"settings_can_be_changed_later": "Ces paramètres peuvent être modifiés ultérieurement dans les paramètres de l'application"
"settings_can_be_changed_later": "Ces paramètres peuvent être modifiés ultérieurement dans les paramètres de l'application",
"add_custom_node": "Ajouter un nouveau nœud personnalisé"
}

View file

@ -663,5 +663,6 @@
"other_settings": "अन्य सेटिंग्स",
"disable_exchange": "एक्सचेंज अक्षम करें",
"advanced_privacy_settings": "उन्नत गोपनीयता सेटिंग्स",
"settings_can_be_changed_later": "इन सेटिंग्स को बाद में ऐप सेटिंग में बदला जा सकता है"
"settings_can_be_changed_later": "इन सेटिंग्स को बाद में ऐप सेटिंग में बदला जा सकता है",
"add_custom_node": "नया कस्टम नोड जोड़ें"
}

View file

@ -663,5 +663,6 @@
"other_settings": "Ostale postavke",
"disable_exchange": "Onemogući exchange",
"advanced_privacy_settings": "Napredne postavke privatnosti",
"settings_can_be_changed_later": "Te se postavke mogu promijeniti kasnije u postavkama aplikacije"
"settings_can_be_changed_later": "Te se postavke mogu promijeniti kasnije u postavkama aplikacije",
"add_custom_node": "Dodaj novi prilagođeni čvor"
}

View file

@ -663,5 +663,6 @@
"other_settings": "Altre impostazioni",
"disable_exchange": "Disabilita scambio",
"advanced_privacy_settings": "Impostazioni avanzate sulla privacy",
"settings_can_be_changed_later": "Queste impostazioni possono essere modificate in seguito nelle impostazioni dell'app"
"settings_can_be_changed_later": "Queste impostazioni possono essere modificate in seguito nelle impostazioni dell'app",
"add_custom_node": "Aggiungi nuovo nodo personalizzato"
}

View file

@ -663,5 +663,6 @@
"other_settings": "その他の設定",
"disable_exchange": "交換を無効にする",
"advanced_privacy_settings": "高度なプライバシー設定",
"settings_can_be_changed_later": "これらの設定は、後でアプリの設定で変更できます"
"settings_can_be_changed_later": "これらの設定は、後でアプリの設定で変更できます",
"add_custom_node": "新しいカスタム ノードを追加"
}

View file

@ -663,5 +663,6 @@
"other_settings": "기타 설정",
"disable_exchange": "교환 비활성화",
"advanced_privacy_settings": "고급 개인 정보 설정",
"settings_can_be_changed_later": "이 설정은 나중에 앱 설정에서 변경할 수 있습니다."
"settings_can_be_changed_later": "이 설정은 나중에 앱 설정에서 변경할 수 있습니다.",
"add_custom_node": "새 사용자 정의 노드 추가"
}

View file

@ -663,5 +663,6 @@
"other_settings": "Andere instellingen",
"disable_exchange": "Uitwisseling uitschakelen",
"advanced_privacy_settings": "Geavanceerde privacy-instellingen",
"settings_can_be_changed_later": "Deze instellingen kunnen later worden gewijzigd in de app-instellingen"
"settings_can_be_changed_later": "Deze instellingen kunnen later worden gewijzigd in de app-instellingen",
"add_custom_node": "Voeg een nieuw aangepast knooppunt toe"
}

View file

@ -663,5 +663,6 @@
"other_settings": "Inne ustawienia",
"disable_exchange": "Wyłącz wymianę",
"advanced_privacy_settings": "Zaawansowane ustawienia prywatności",
"settings_can_be_changed_later": "Te ustawienia można później zmienić w ustawieniach aplikacji"
"settings_can_be_changed_later": "Te ustawienia można później zmienić w ustawieniach aplikacji",
"add_custom_node": "Dodaj nowy węzeł niestandardowy"
}

View file

@ -662,5 +662,6 @@
"other_settings": "Outras configurações",
"disable_exchange": "Desativar troca",
"advanced_privacy_settings": "Configurações de privacidade avançadas",
"settings_can_be_changed_later": "Essas configurações podem ser alteradas posteriormente nas configurações do aplicativo"
"settings_can_be_changed_later": "Essas configurações podem ser alteradas posteriormente nas configurações do aplicativo",
"add_custom_node": "Adicionar novo nó personalizado"
}

View file

@ -663,5 +663,6 @@
"other_settings": "Другие настройки",
"disable_exchange": "Отключить обмен",
"advanced_privacy_settings": "Расширенные настройки конфиденциальности",
"settings_can_be_changed_later": "Эти настройки можно изменить позже в настройках приложения."
"settings_can_be_changed_later": "Эти настройки можно изменить позже в настройках приложения.",
"add_custom_node": "Добавить новый пользовательский узел"
}

View file

@ -662,5 +662,6 @@
"other_settings": "Інші налаштування",
"disable_exchange": "Вимкнути exchange",
"advanced_privacy_settings": "Розширені налаштування конфіденційності",
"settings_can_be_changed_later": "Ці параметри можна змінити пізніше в налаштуваннях програми"
"settings_can_be_changed_later": "Ці параметри можна змінити пізніше в налаштуваннях програми",
"add_custom_node": "Додати новий спеціальний вузол"
}

View file

@ -661,5 +661,6 @@
"other_settings": "其他设置",
"disable_exchange": "禁用交换",
"advanced_privacy_settings": "高级隐私设置",
"settings_can_be_changed_later": "稍后可以在应用设置中更改这些设置"
"settings_can_be_changed_later": "稍后可以在应用设置中更改这些设置",
"add_custom_node": "添加新的自定义节点"
}