Merge branch 'main' of https://github.com/cake-tech/cake_wallet into CW-62-send-all-fee-calculation

 Conflicts:
	lib/view_model/send/send_view_model.dart
This commit is contained in:
OmarHatem 2022-12-02 13:55:25 +02:00
commit b641b5faf1
52 changed files with 1150 additions and 835 deletions

129
.github/workflows/pr_test_build.yml vendored Normal file
View file

@ -0,0 +1,129 @@
name: PR Test Build
on:
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '8.x'
- name: Flutter action
uses: subosito/flutter-action@v1
with:
flutter-version: '3.3.x'
channel: stable
- name: Install package dependencies
run: sudo apt-get install -y curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake clang
- name: Execute Build and Setup Commands
run: |
sudo mkdir -p /opt/android
sudo chown $USER /opt/android
cd /opt/android
git clone https://github.com/cake-tech/cake_wallet.git --branch $GITHUB_HEAD_REF
cd cake_wallet/scripts/android/
./install_ndk.sh
source ./app_env.sh cakewallet
./app_config.sh
./build_all.sh
./copy_monero_deps.sh
- name: Install Flutter dependencies
run: |
cd /opt/android/cake_wallet
flutter pub get
- name: Generate KeyStore
run: |
cd /opt/android/cake_wallet/android/app
keytool -genkey -v -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias testKey -noprompt -dname "CN=CakeWallet, OU=CakeWallet, O=CakeWallet, L=Florida, S=America, C=USA" -storepass ${{ secrets.STORE_PASS }} -keypass ${{ secrets.KEY_PASS }}
- name: Generate key properties
run: |
cd /opt/android/cake_wallet
flutter packages pub run tool/generate_android_key_properties.dart keyAlias=testKey storeFile=key.jks storePassword=${{ secrets.STORE_PASS }} keyPassword=${{ secrets.KEY_PASS }}
- name: Generate localization
run: |
cd /opt/android/cake_wallet
flutter packages pub run tool/generate_localization.dart
- name: Build generated code
run: |
cd /opt/android/cake_wallet
cd cw_core && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_monero && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_haven && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
flutter packages pub run build_runner build --delete-conflicting-outputs
- name: Add secrets
run: |
cd /opt/android/cake_wallet
touch lib/.secrets.g.dart
echo "const salt = '${{ secrets.SALT }}';" > lib/.secrets.g.dart
echo "const keychainSalt = '${{ secrets.KEY_CHAIN_SALT }}';" >> lib/.secrets.g.dart
echo "const key = '${{ secrets.KEY }}';" >> lib/.secrets.g.dart
echo "const walletSalt = '${{ secrets.WALLET_SALT }}';" >> lib/.secrets.g.dart
echo "const shortKey = '${{ secrets.SHORT_KEY }}';" >> lib/.secrets.g.dart
echo "const backupSalt = '${{ secrets.BACKUP_SALT }}';" >> lib/.secrets.g.dart
echo "const backupKeychainSalt = '${{ secrets.BACKUP_KEY_CHAIN_SALT }}';" >> lib/.secrets.g.dart
echo "const changeNowApiKey = '${{ secrets.CHANGE_NOW_API_KEY }}';" >> lib/.secrets.g.dart
echo "const wyreSecretKey = '${{ secrets.WYRE_SECRET_KEY }}';" >> lib/.secrets.g.dart
echo "const wyreApiKey = '${{ secrets.WYRE_API_KEY }}';" >> lib/.secrets.g.dart
echo "const wyreAccountId = '${{ secrets.WYRE_ACCOUNT_ID }}';" >> lib/.secrets.g.dart
echo "const moonPayApiKey = '${{ secrets.MOON_PAY_API_KEY }}';" >> lib/.secrets.g.dart
echo "const moonPaySecretKey = '${{ secrets.MOON_PAY_SECRET_KEY }}';" >> lib/.secrets.g.dart
echo "const sideShiftAffiliateId = '${{ secrets.SIDE_SHIFT_AFFILIATE_ID }}';" >> lib/.secrets.g.dart
echo "const sideShiftApiKey = '${{ secrets.SIDE_SHIFT_API_KEY }}';" >> lib/.secrets.g.dart
echo "const simpleSwapApiKey = '${{ secrets.SIMPLE_SWAP_API_KEY }}';" >> lib/.secrets.g.dart
echo "const onramperApiKey = '${{ secrets.ONRAMPER_API_KEY }}';" >> lib/.secrets.g.dart
echo "const anypayToken = '${{ secrets.ANY_PAY_TOKEN }}';" >> lib/.secrets.g.dart
echo "const ioniaClientId = '${{ secrets.IONIA_CLIENT_ID }}';" >> lib/.secrets.g.dart
- name: Rename app
run: sed -i -e "s/\${APP_NAME}/$GITHUB_HEAD_REF/g" /opt/android/cake_wallet/android/app/src/main/AndroidManifest.xml
- name: Build
run: |
cd /opt/android/cake_wallet
flutter build apk --release
# - name: Push to App Center
# run: |
# echo 'Installing App Center CLI tools'
# npm install -g appcenter-cli
# echo "Publishing test to App Center"
# appcenter distribute release \
# --group "Testers" \
# --file "/opt/android/cake_wallet/build/app/outputs/apk/release/app-release.apk" \
# --release-notes ${GITHUB_HEAD_REF} \
# --app Cake-Labs/Cake-Wallet \
# --token ${{ secrets.APP_CENTER_TOKEN }} \
# --quiet
- name: Send Test APK
run: |
cd /opt/android/cake_wallet
var=$(curl --upload-file build/app/outputs/apk/release/app-release.apk https://transfer.sh/$GITHUB_HEAD_REF.apk -H "Max-Days: 10")
curl ${{ secrets.SLACK_WEB_HOOK }} -H "Content-Type: application/json" -d '{"apk_link": "'"$var"'","ticket": "'"$GITHUB_HEAD_REF"'"}'
- name: Rename apk file
run: |
cd /opt/android/cake_wallet/build/app/outputs/apk/release
mkdir test-apk
mv app-release.apk test-apk/$GITHUB_HEAD_REF.apk
- name: Upload Artifact
uses: kittaakos/upload-artifact-as-is@v0
with:
path: /opt/android/cake_wallet/build/app/outputs/apk/release/test-apk/

View file

@ -135,7 +135,7 @@ abstract class ElectrumWalletBase extends WalletBase<ElectrumBalance,
@override @override
Future<void> startSync() async { Future<void> startSync() async {
try { try {
syncStatus = StartingSyncStatus(); syncStatus = AttemptingSyncStatus();
await walletAddresses.discoverAddresses(); await walletAddresses.discoverAddresses();
await updateTransactions(); await updateTransactions();
_subscribeForUpdates(); _subscribeForUpdates();

View file

@ -28,7 +28,7 @@ class NotConnectedSyncStatus extends SyncStatus {
double progress() => 0.0; double progress() => 0.0;
} }
class StartingSyncStatus extends SyncStatus { class AttemptingSyncStatus extends SyncStatus {
@override @override
double progress() => 0.0; double progress() => 0.0;
} }

View file

@ -138,7 +138,7 @@ abstract class HavenWalletBase extends WalletBase<MoneroBalance,
} catch (_) {} } catch (_) {}
try { try {
syncStatus = StartingSyncStatus(); syncStatus = AttemptingSyncStatus();
haven_wallet.startRefresh(); haven_wallet.startRefresh();
_setListeners(); _setListeners();
_listener?.start(); _listener?.start();

View file

@ -154,7 +154,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
} catch (_) {} } catch (_) {}
try { try {
syncStatus = StartingSyncStatus(); syncStatus = AttemptingSyncStatus();
monero_wallet.startRefresh(); monero_wallet.startRefresh();
_setListeners(); _setListeners();
_listener?.start(); _listener?.start();

View file

@ -55,7 +55,7 @@ You may download and install the latest version of Android Studio [here](https:/
### 3. Installing Flutter ### 3. Installing Flutter
Need to install flutter with version `2.0.4`. For this please check section [Install Flutter manually](https://docs.flutter.dev/get-started/install/linux#install-flutter-manually). When flutter repository is downloaded please open it with `cd <flutter-path>` and checkout version 2.0.4 by `git checkout 2.0.4`. Need to install flutter with version `3.x.x`. For this please check section [Install Flutter manually](https://docs.flutter.dev/get-started/install/linux#install-flutter-manually).
### 4. Verify Installations ### 4. Verify Installations
@ -66,7 +66,7 @@ Verify that the Android toolchain, Flutter, and Android Studio have been correct
The output of this command will appear like this, indicating successful installations. If there are problems with your installation, they **must** be corrected before proceeding. The output of this command will appear like this, indicating successful installations. If there are problems with your installation, they **must** be corrected before proceeding.
``` ```
Doctor summary (to see all details, run flutter doctor -v): Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.4, on Linux, locale en_US.UTF-8) [✓] Flutter (Channel stable, 3.x.x, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 28) [✓] Android toolchain - develop for Android devices (Android SDK version 28)
[✓] Android Studio (version 4.0) [✓] Android Studio (version 4.0)
``` ```
@ -156,6 +156,10 @@ Generate mobx models for `cw_bitcoin`:
`cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..` `cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..`
Generate mobx models for `cw_haven`:
`cd cw_haven && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..`
Finally build mobx models for the app: Finally build mobx models for the app:
`$ flutter packages pub run build_runner build --delete-conflicting-outputs` `$ flutter packages pub run build_runner build --delete-conflicting-outputs`

View file

@ -14,8 +14,8 @@ String syncStatusTitle(SyncStatus syncStatus) {
return S.current.sync_status_not_connected; return S.current.sync_status_not_connected;
} }
if (syncStatus is StartingSyncStatus) { if (syncStatus is AttemptingSyncStatus) {
return S.current.sync_status_starting_sync; return S.current.sync_status_attempting_sync;
} }
if (syncStatus is FailedSyncStatus) { if (syncStatus is FailedSyncStatus) {

View file

@ -5,9 +5,14 @@ import 'package:cake_wallet/ionia/ionia_anypay.dart';
import 'package:cake_wallet/ionia/ionia_gift_card.dart'; import 'package:cake_wallet/ionia/ionia_gift_card.dart';
import 'package:cake_wallet/ionia/ionia_tip.dart'; import 'package:cake_wallet/ionia/ionia_tip.dart';
import 'package:cake_wallet/src/screens/buy/onramper_page.dart'; import 'package:cake_wallet/src/screens/buy/onramper_page.dart';
import 'package:cake_wallet/src/screens/settings/display_settings_page.dart';
import 'package:cake_wallet/src/screens/settings/other_settings_page.dart';
import 'package:cake_wallet/src/screens/settings/privacy_page.dart';
import 'package:cake_wallet/src/screens/settings/security_backup_page.dart';
import 'package:cake_wallet/src/screens/ionia/cards/ionia_custom_redeem_page.dart'; import 'package:cake_wallet/src/screens/ionia/cards/ionia_custom_redeem_page.dart';
import 'package:cake_wallet/src/screens/ionia/cards/ionia_gift_card_detail_page.dart'; import 'package:cake_wallet/src/screens/ionia/cards/ionia_gift_card_detail_page.dart';
import 'package:cake_wallet/src/screens/ionia/cards/ionia_more_options_page.dart'; import 'package:cake_wallet/src/screens/ionia/cards/ionia_more_options_page.dart';
import 'package:cake_wallet/src/screens/settings/connection_sync_page.dart';
import 'package:cake_wallet/view_model/ionia/ionia_auth_view_model.dart'; import 'package:cake_wallet/view_model/ionia/ionia_auth_view_model.dart';
import 'package:cake_wallet/view_model/ionia/ionia_buy_card_view_model.dart'; import 'package:cake_wallet/view_model/ionia/ionia_buy_card_view_model.dart';
import 'package:cake_wallet/view_model/ionia/ionia_custom_tip_view_model.dart'; import 'package:cake_wallet/view_model/ionia/ionia_custom_tip_view_model.dart';
@ -26,6 +31,10 @@ import 'package:cake_wallet/src/screens/dashboard/widgets/balance_page.dart';
import 'package:cake_wallet/view_model/ionia/ionia_account_view_model.dart'; import 'package:cake_wallet/view_model/ionia/ionia_account_view_model.dart';
import 'package:cake_wallet/view_model/ionia/ionia_gift_cards_list_view_model.dart'; import 'package:cake_wallet/view_model/ionia/ionia_gift_cards_list_view_model.dart';
import 'package:cake_wallet/view_model/ionia/ionia_purchase_merch_view_model.dart'; import 'package:cake_wallet/view_model/ionia/ionia_purchase_merch_view_model.dart';
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:cw_core/unspent_coins_info.dart'; import 'package:cw_core/unspent_coins_info.dart';
import 'package:cake_wallet/core/backup_service.dart'; import 'package:cake_wallet/core/backup_service.dart';
import 'package:cw_core/wallet_service.dart'; import 'package:cw_core/wallet_service.dart';
@ -49,7 +58,6 @@ import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_page.dart'
import 'package:cake_wallet/src/screens/faq/faq_page.dart'; import 'package:cake_wallet/src/screens/faq/faq_page.dart';
import 'package:cake_wallet/src/screens/new_wallet/new_wallet_type_page.dart'; import 'package:cake_wallet/src/screens/new_wallet/new_wallet_type_page.dart';
import 'package:cake_wallet/src/screens/nodes/node_create_or_edit_page.dart'; import 'package:cake_wallet/src/screens/nodes/node_create_or_edit_page.dart';
import 'package:cake_wallet/src/screens/nodes/nodes_list_page.dart';
import 'package:cake_wallet/src/screens/order_details/order_details_page.dart'; import 'package:cake_wallet/src/screens/order_details/order_details_page.dart';
import 'package:cake_wallet/src/screens/pin_code/pin_code_widget.dart'; import 'package:cake_wallet/src/screens/pin_code/pin_code_widget.dart';
import 'package:cake_wallet/src/screens/rescan/rescan_page.dart'; import 'package:cake_wallet/src/screens/rescan/rescan_page.dart';
@ -59,7 +67,6 @@ import 'package:cake_wallet/src/screens/restore/wallet_restore_page.dart';
import 'package:cake_wallet/src/screens/seed/pre_seed_page.dart'; import 'package:cake_wallet/src/screens/seed/pre_seed_page.dart';
import 'package:cake_wallet/src/screens/seed/wallet_seed_page.dart'; import 'package:cake_wallet/src/screens/seed/wallet_seed_page.dart';
import 'package:cake_wallet/src/screens/send/send_template_page.dart'; import 'package:cake_wallet/src/screens/send/send_template_page.dart';
import 'package:cake_wallet/src/screens/settings/settings.dart';
import 'package:cake_wallet/src/screens/setup_pin_code/setup_pin_code.dart'; import 'package:cake_wallet/src/screens/setup_pin_code/setup_pin_code.dart';
import 'package:cake_wallet/src/screens/support/support_page.dart'; import 'package:cake_wallet/src/screens/support/support_page.dart';
import 'package:cake_wallet/src/screens/trade_details/trade_details_page.dart'; import 'package:cake_wallet/src/screens/trade_details/trade_details_page.dart';
@ -115,7 +122,6 @@ import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_v
import 'package:cake_wallet/view_model/monero_account_list/monero_account_edit_or_create_view_model.dart'; import 'package:cake_wallet/view_model/monero_account_list/monero_account_edit_or_create_view_model.dart';
import 'package:cake_wallet/view_model/monero_account_list/monero_account_list_view_model.dart'; import 'package:cake_wallet/view_model/monero_account_list/monero_account_list_view_model.dart';
import 'package:cake_wallet/view_model/send/send_view_model.dart'; import 'package:cake_wallet/view_model/send/send_view_model.dart';
import 'package:cake_wallet/view_model/settings/settings_view_model.dart';
import 'package:cake_wallet/view_model/wallet_keys_view_model.dart'; import 'package:cake_wallet/view_model/wallet_keys_view_model.dart';
import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart'; import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
import 'package:cake_wallet/view_model/wallet_restore_view_model.dart'; import 'package:cake_wallet/view_model/wallet_restore_view_model.dart';
@ -377,8 +383,7 @@ Future setup(
_transactionDescriptionBox)); _transactionDescriptionBox));
getIt.registerFactory( getIt.registerFactory(
() => SendPage(sendViewModel: getIt.get<SendViewModel>(), () => SendPage(sendViewModel: getIt.get<SendViewModel>()));
settingsViewModel: getIt.get<SettingsViewModel>()));
getIt.registerFactory(() => SendTemplatePage( getIt.registerFactory(() => SendTemplatePage(
sendTemplateViewModel: getIt.get<SendTemplateViewModel>())); sendTemplateViewModel: getIt.get<SendTemplateViewModel>()));
@ -434,12 +439,20 @@ Future setup(
getIt.get<MoneroAccountEditOrCreateViewModel>(param1: account))); getIt.get<MoneroAccountEditOrCreateViewModel>(param1: account)));
getIt.registerFactory(() { getIt.registerFactory(() {
final appStore = getIt.get<AppStore>(); return DisplaySettingsViewModel(getIt.get<SettingsStore>());
final yatStore = getIt.get<YatStore>();
return SettingsViewModel(appStore.settingsStore, yatStore, appStore.wallet!);
}); });
getIt.registerFactory(() => SettingsPage(getIt.get<SettingsViewModel>())); getIt.registerFactory(() {
return PrivacySettingsViewModel(getIt.get<SettingsStore>());
});
getIt.registerFactory(() {
return OtherSettingsViewModel(getIt.get<SettingsStore>(), getIt.get<AppStore>().wallet!);
});
getIt.registerFactory(() {
return SecuritySettingsViewModel(getIt.get<SettingsStore>());
});
getIt getIt
.registerFactory(() => WalletSeedViewModel(getIt.get<AppStore>().wallet!)); .registerFactory(() => WalletSeedViewModel(getIt.get<AppStore>().wallet!));
@ -475,7 +488,15 @@ Future setup(
_nodeSource, appStore.wallet!, appStore.settingsStore); _nodeSource, appStore.wallet!, appStore.settingsStore);
}); });
getIt.registerFactory(() => NodeListPage(getIt.get<NodeListViewModel>())); getIt.registerFactory(() => ConnectionSyncPage(getIt.get<NodeListViewModel>(), getIt.get<DashboardViewModel>()));
getIt.registerFactory(() => SecurityBackupPage(getIt.get<SecuritySettingsViewModel>()));
getIt.registerFactory(() => PrivacyPage(getIt.get<PrivacySettingsViewModel>()));
getIt.registerFactory(() => DisplaySettingsPage(getIt.get<DisplaySettingsViewModel>()));
getIt.registerFactory(() => OtherSettingsPage(getIt.get<OtherSettingsViewModel>()));
getIt.registerFactory(() => getIt.registerFactory(() =>
NodeCreateOrEditViewModel(_nodeSource, getIt.get<AppStore>().wallet!)); NodeCreateOrEditViewModel(_nodeSource, getIt.get<AppStore>().wallet!));
@ -494,7 +515,6 @@ Future setup(
getIt.get<TradesStore>(), getIt.get<TradesStore>(),
getIt.get<AppStore>().settingsStore, getIt.get<AppStore>().settingsStore,
getIt.get<SharedPreferences>(), getIt.get<SharedPreferences>(),
getIt.get<SettingsViewModel>(),
)); ));
getIt.registerFactory(() => ExchangeTradeViewModel( getIt.registerFactory(() => ExchangeTradeViewModel(

View file

@ -11,6 +11,7 @@ class PreferencesKey {
static const shouldSaveRecipientAddressKey = 'save_recipient_address'; static const shouldSaveRecipientAddressKey = 'save_recipient_address';
static const allowBiometricalAuthenticationKey = static const allowBiometricalAuthenticationKey =
'allow_biometrical_authentication'; 'allow_biometrical_authentication';
static const disableExchangeKey = 'disable_exchange';
static const currentTheme = 'current_theme'; static const currentTheme = 'current_theme';
static const isDarkThemeLegacy = 'dark_theme'; static const isDarkThemeLegacy = 'dark_theme';
static const displayActionListModeKey = 'display_list_mode'; static const displayActionListModeKey = 'display_list_mode';

View file

@ -0,0 +1,21 @@
import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cake_wallet/haven/haven.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cw_core/transaction_priority.dart';
import 'package:cw_core/wallet_type.dart';
List<TransactionPriority> priorityForWalletType(WalletType type) {
switch (type) {
case WalletType.monero:
return monero!.getTransactionPriorities();
case WalletType.bitcoin:
return bitcoin!.getTransactionPriorities();
case WalletType.litecoin:
return bitcoin!.getLitecoinTransactionPriorities();
case WalletType.haven:
return haven!.getTransactionPriorities();
default:
return [];
}
}

View file

@ -5,6 +5,10 @@ import 'package:cake_wallet/src/screens/backup/edit_backup_password_page.dart';
import 'package:cake_wallet/src/screens/buy/buy_webview_page.dart'; import 'package:cake_wallet/src/screens/buy/buy_webview_page.dart';
import 'package:cake_wallet/src/screens/buy/onramper_page.dart'; import 'package:cake_wallet/src/screens/buy/onramper_page.dart';
import 'package:cake_wallet/src/screens/buy/pre_order_page.dart'; import 'package:cake_wallet/src/screens/buy/pre_order_page.dart';
import 'package:cake_wallet/src/screens/settings/display_settings_page.dart';
import 'package:cake_wallet/src/screens/settings/other_settings_page.dart';
import 'package:cake_wallet/src/screens/settings/privacy_page.dart';
import 'package:cake_wallet/src/screens/settings/security_backup_page.dart';
import 'package:cake_wallet/src/screens/ionia/cards/ionia_account_cards_page.dart'; import 'package:cake_wallet/src/screens/ionia/cards/ionia_account_cards_page.dart';
import 'package:cake_wallet/src/screens/ionia/cards/ionia_account_page.dart'; import 'package:cake_wallet/src/screens/ionia/cards/ionia_account_page.dart';
import 'package:cake_wallet/src/screens/ionia/cards/ionia_custom_redeem_page.dart'; import 'package:cake_wallet/src/screens/ionia/cards/ionia_custom_redeem_page.dart';
@ -16,6 +20,7 @@ import 'package:cake_wallet/src/screens/pin_code/pin_code_widget.dart';
import 'package:cake_wallet/src/screens/restore/restore_from_backup_page.dart'; import 'package:cake_wallet/src/screens/restore/restore_from_backup_page.dart';
import 'package:cake_wallet/src/screens/restore/wallet_restore_page.dart'; import 'package:cake_wallet/src/screens/restore/wallet_restore_page.dart';
import 'package:cake_wallet/src/screens/seed/pre_seed_page.dart'; import 'package:cake_wallet/src/screens/seed/pre_seed_page.dart';
import 'package:cake_wallet/src/screens/settings/connection_sync_page.dart';
import 'package:cake_wallet/src/screens/support/support_page.dart'; import 'package:cake_wallet/src/screens/support/support_page.dart';
import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_details_page.dart'; import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_details_page.dart';
import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_list_page.dart'; import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_list_page.dart';
@ -36,7 +41,6 @@ import 'package:cake_wallet/src/screens/dashboard/dashboard_page.dart';
import 'package:cake_wallet/src/screens/seed/wallet_seed_page.dart'; import 'package:cake_wallet/src/screens/seed/wallet_seed_page.dart';
import 'package:cake_wallet/src/screens/auth/auth_page.dart'; import 'package:cake_wallet/src/screens/auth/auth_page.dart';
import 'package:cake_wallet/src/screens/nodes/node_create_or_edit_page.dart'; import 'package:cake_wallet/src/screens/nodes/node_create_or_edit_page.dart';
import 'package:cake_wallet/src/screens/nodes/nodes_list_page.dart';
import 'package:cake_wallet/src/screens/receive/receive_page.dart'; import 'package:cake_wallet/src/screens/receive/receive_page.dart';
import 'package:cake_wallet/src/screens/subaddress/address_edit_or_create_page.dart'; import 'package:cake_wallet/src/screens/subaddress/address_edit_or_create_page.dart';
import 'package:cake_wallet/src/screens/wallet_list/wallet_list_page.dart'; import 'package:cake_wallet/src/screens/wallet_list/wallet_list_page.dart';
@ -56,7 +60,6 @@ import 'package:cake_wallet/src/screens/contact/contact_page.dart';
import 'package:cake_wallet/src/screens/wallet_keys/wallet_keys_page.dart'; import 'package:cake_wallet/src/screens/wallet_keys/wallet_keys_page.dart';
import 'package:cake_wallet/src/screens/restore/restore_wallet_from_seed_details.dart'; import 'package:cake_wallet/src/screens/restore/restore_wallet_from_seed_details.dart';
import 'package:cake_wallet/src/screens/exchange/exchange_page.dart'; import 'package:cake_wallet/src/screens/exchange/exchange_page.dart';
import 'package:cake_wallet/src/screens/settings/settings.dart';
import 'package:cake_wallet/src/screens/rescan/rescan_page.dart'; import 'package:cake_wallet/src/screens/rescan/rescan_page.dart';
import 'package:cake_wallet/src/screens/faq/faq_page.dart'; import 'package:cake_wallet/src/screens/faq/faq_page.dart';
import 'package:cake_wallet/src/screens/trade_details/trade_details_page.dart'; import 'package:cake_wallet/src/screens/trade_details/trade_details_page.dart';
@ -274,9 +277,25 @@ Route<dynamic> createRoute(RouteSettings settings) {
param2: false), param2: false),
onWillPop: () async => false)); onWillPop: () async => false));
case Routes.nodeList: case Routes.connectionSync:
return CupertinoPageRoute<void>( return CupertinoPageRoute<void>(
builder: (_) => getIt.get<NodeListPage>()); builder: (_) => getIt.get<ConnectionSyncPage>());
case Routes.securityBackupPage:
return CupertinoPageRoute<void>(
builder: (_) => getIt.get<SecurityBackupPage>());
case Routes.privacyPage:
return CupertinoPageRoute<void>(
builder: (_) => getIt.get<PrivacyPage>());
case Routes.displaySettingsPage:
return CupertinoPageRoute<void>(
builder: (_) => getIt.get<DisplaySettingsPage>());
case Routes.otherSettingsPage:
return CupertinoPageRoute<void>(
builder: (_) => getIt.get<OtherSettingsPage>());
case Routes.newNode: case Routes.newNode:
return CupertinoPageRoute<void>( return CupertinoPageRoute<void>(
@ -360,9 +379,6 @@ Route<dynamic> createRoute(RouteSettings settings) {
return CupertinoPageRoute<void>( return CupertinoPageRoute<void>(
builder: (_) => getIt.get<ExchangeTemplatePage>()); builder: (_) => getIt.get<ExchangeTemplatePage>());
case Routes.settings:
return MaterialPageRoute<void>(builder: (_) => getIt.get<SettingsPage>());
case Routes.rescan: case Routes.rescan:
return MaterialPageRoute<void>(builder: (_) => getIt.get<RescanPage>()); return MaterialPageRoute<void>(builder: (_) => getIt.get<RescanPage>());

View file

@ -21,7 +21,6 @@ class Routes {
static const seedLanguage = '/seed_language'; static const seedLanguage = '/seed_language';
static const walletList = '/view_model.wallet_list'; static const walletList = '/view_model.wallet_list';
static const auth = '/auth'; static const auth = '/auth';
static const nodeList = '/node_list';
static const newNode = '/new_node_list'; static const newNode = '/new_node_list';
static const login = '/login'; static const login = '/login';
static const splash = '/splash'; static const splash = '/splash';
@ -77,4 +76,9 @@ class Routes {
static const ioniaMoreOptionsPage = '/ionia_more_options_page'; static const ioniaMoreOptionsPage = '/ionia_more_options_page';
static const ioniaCustomRedeemPage = '/ionia_custom_redeem_page'; static const ioniaCustomRedeemPage = '/ionia_custom_redeem_page';
static const onramperPage = '/onramper'; static const onramperPage = '/onramper';
static const connectionSync = '/connection_sync_page';
static const securityBackupPage = '/security_and_backup_page';
static const privacyPage = '/privacy_page';
static const displaySettingsPage = '/display_settings_page';
static const otherSettingsPage = '/other_settings_page';
} }

View file

@ -60,7 +60,7 @@ class DashboardPage extends BasePage {
Widget middle(BuildContext context) { Widget middle(BuildContext context) {
return SyncIndicator(dashboardViewModel: walletViewModel, return SyncIndicator(dashboardViewModel: walletViewModel,
onTap: () => Navigator.of(context, rootNavigator: true) onTap: () => Navigator.of(context, rootNavigator: true)
.pushNamed(Routes.nodeList)); .pushNamed(Routes.connectionSync));
} }
@override @override
@ -315,6 +315,8 @@ class DashboardPage extends BasePage {
} }
Future<void> _onClickExchangeButton(BuildContext context) async { Future<void> _onClickExchangeButton(BuildContext context) async {
if (walletViewModel.isEnabledExchangeAction) {
await Navigator.of(context).pushNamed(Routes.exchange); await Navigator.of(context).pushNamed(Routes.exchange);
} }
}
} }

View file

@ -1,12 +1,8 @@
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/screens/dashboard/wallet_menu_item.dart'; import 'package:cake_wallet/src/screens/dashboard/wallet_menu_item.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
// FIXME: terrible design // FIXME: terrible design
@ -14,68 +10,55 @@ class WalletMenu {
WalletMenu(this.context, this.reconnect, this.hasRescan) : items = [] { WalletMenu(this.context, this.reconnect, this.hasRescan) : items = [] {
items.addAll([ items.addAll([
WalletMenuItem( WalletMenuItem(
title: S.current.reconnect, title: S.current.connection_sync,
image: Image.asset('assets/images/reconnect_menu.png', image: Image.asset('assets/images/nodes_menu.png',
height: 16, width: 16), height: 16, width: 16),
handler: () => _presentReconnectAlert(context)), handler: () => Navigator.of(context).pushNamed(Routes.connectionSync),
if (hasRescan) ),
WalletMenuItem(
title: S.current.rescan,
image: Image.asset('assets/images/filter_icon.png',
height: 16, width: 16, color: Palette.darkBlue),
handler: () => Navigator.of(context).pushNamed(Routes.rescan)),
WalletMenuItem( WalletMenuItem(
title: S.current.wallets, title: S.current.wallets,
image: Image.asset('assets/images/wallet_menu.png', image: Image.asset('assets/images/wallet_menu.png',
height: 16, width: 16), height: 16, width: 16),
handler: () => Navigator.of(context).pushNamed(Routes.walletList)), handler: () => Navigator.of(context).pushNamed(Routes.walletList),
),
WalletMenuItem( WalletMenuItem(
title: S.current.nodes, title: S.current.security_and_backup,
image: Image.asset('assets/images/nodes_menu.png',
height: 16, width: 16),
handler: () => Navigator.of(context).pushNamed(Routes.nodeList)),
WalletMenuItem(
title: S.current.show_keys,
image: image:
Image.asset('assets/images/key_menu.png', height: 16, width: 16), Image.asset('assets/images/key_menu.png', height: 16, width: 16),
handler: () { handler: () {
Navigator.of(context).pushNamed(Routes.auth, Navigator.of(context).pushNamed(Routes.securityBackupPage);
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) { }),
if (isAuthenticatedSuccessfully) { WalletMenuItem(
auth.close(route: Routes.showKeys); title: S.current.privacy,
} image:
}); Image.asset('assets/images/eye_menu.png', height: 16, width: 16),
handler: () {
Navigator.of(context).pushNamed(Routes.privacyPage);
}), }),
WalletMenuItem( WalletMenuItem(
title: S.current.address_book_menu, title: S.current.address_book_menu,
image: Image.asset('assets/images/open_book_menu.png', image: Image.asset('assets/images/open_book_menu.png',
height: 16, width: 16), height: 16, width: 16),
handler: () => Navigator.of(context).pushNamed(Routes.addressBook)), handler: () => Navigator.of(context).pushNamed(Routes.addressBook),
),
WalletMenuItem( WalletMenuItem(
title: S.current.backup, title: S.current.display_settings,
image: Image.asset('assets/images/restore_wallet.png', image: Image.asset('assets/images/eye_menu.png',
height: 16, height: 16, width: 16),
width: 16, handler: () => Navigator.of(context).pushNamed(Routes.displaySettingsPage),
color: Palette.darkBlue), ),
handler: () {
Navigator.of(context).pushNamed(
Routes.auth,
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) {
if (isAuthenticatedSuccessfully) {
auth.close(route:Routes.backup);
}
});
}),
WalletMenuItem( WalletMenuItem(
title: S.current.settings_title, title: S.current.other_settings,
image: Image.asset('assets/images/settings_menu.png', image: Image.asset('assets/images/settings_menu.png',
height: 16, width: 16), height: 16, width: 16),
handler: () => Navigator.of(context).pushNamed(Routes.settings)), handler: () => Navigator.of(context).pushNamed(Routes.otherSettingsPage),
),
WalletMenuItem( WalletMenuItem(
title: S.current.settings_support, title: S.current.settings_support,
image: Image.asset('assets/images/question_mark.png', image: Image.asset('assets/images/question_mark.png',
height: 16, width: 16, color: Palette.darkBlue), height: 16, width: 16, color: Palette.darkBlue),
handler: () => Navigator.of(context).pushNamed(Routes.support)), handler: () => Navigator.of(context).pushNamed(Routes.support),
),
]); ]);
} }
@ -86,23 +69,6 @@ class WalletMenu {
void action(int index) { void action(int index) {
final item = items[index]; final item = items[index];
item?.handler(); item.handler();
}
Future<void> _presentReconnectAlert(BuildContext context) async {
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
alertTitle: S.of(context).reconnection,
alertContent: S.of(context).reconnect_alert_text,
rightButtonText: S.of(context).ok,
leftButtonText: S.of(context).cancel,
actionRightButton: () async {
Navigator.of(context).pop();
await reconnect?.call();
},
actionLeftButton: () => Navigator.of(context).pop());
});
} }
} }

View file

@ -1,166 +0,0 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cw_core/node.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/nodes/widgets/node_list_row.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/view_model/node_list/node_list_view_model.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
class NodeListPage extends BasePage {
NodeListPage(this.nodeListViewModel);
@override
String get title => S.current.nodes;
final NodeListViewModel nodeListViewModel;
@override
Widget trailing(context) {
return Container(
height: 32,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(16)),
color: Theme.of(context).accentTextTheme.caption!.color!),
child: ButtonTheme(
minWidth: double.minPositive,
child: TextButton(
onPressed: () async {
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
alertTitle: S.of(context).node_reset_settings_title,
alertContent:
S.of(context).nodes_list_reset_to_default_message,
rightButtonText: S.of(context).reset,
leftButtonText: S.of(context).cancel,
actionRightButton: () async {
Navigator.of(context).pop();
await nodeListViewModel.reset();
},
actionLeftButton: () => Navigator.of(context).pop());
});
},
child: Text(
S.of(context).reset,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Palette.blueCraiola),
)),
),
);
}
@override
Widget body(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 10),
child: Observer(
builder: (BuildContext context) {
return SectionStandardList(
sectionCount: 2,
context: context,
itemCounter: (int sectionIndex) {
if (sectionIndex == 0) {
return 1;
}
return nodeListViewModel.nodes.length;
},
itemBuilder: (_, sectionIndex, index) {
if (sectionIndex == 0) {
return NodeHeaderListRow(
title: S.of(context).add_new_node,
onTap: (_) async => await Navigator.of(context)
.pushNamed(Routes.newNode));
}
final node = nodeListViewModel.nodes[index];
final isSelected =
node.keyIndex == nodeListViewModel.currentNode.keyIndex;
final nodeListRow = NodeListRow(
title: node.uriRaw,
isSelected: isSelected,
isAlive: node.requestNode(),
onTap: (_) async {
if (isSelected) {
return;
}
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
alertTitle:
S.of(context).change_current_node_title,
alertContent: S
.of(context)
.change_current_node(node.uriRaw),
leftButtonText: S.of(context).cancel,
rightButtonText: S.of(context).change,
actionLeftButton: () =>
Navigator.of(context).pop(),
actionRightButton: () async {
await nodeListViewModel.setAsCurrent(node);
Navigator.of(context).pop();
});
});
});
final dismissibleRow = Slidable(
key: Key('${node.keyIndex}'),
startActionPane: _actionPane(context, node),
endActionPane: _actionPane(context, node),
child: nodeListRow,
);
return isSelected ? nodeListRow : dismissibleRow;
});
},
),
);
}
ActionPane _actionPane(BuildContext context, Node node) => ActionPane(
motion: const ScrollMotion(),
extentRatio: 0.3,
children: [
SlidableAction(
onPressed: (context) async {
final confirmed = await showPopUp<bool>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
alertTitle: S.of(context).remove_node,
alertContent:
S.of(context).remove_node_message,
rightButtonText: S.of(context).remove,
leftButtonText: S.of(context).cancel,
actionRightButton: () =>
Navigator.pop(context, true),
actionLeftButton: () =>
Navigator.pop(context, false));
}) ??
false;
if (confirmed) {
await nodeListViewModel.delete(node);
}
},
backgroundColor: Colors.red,
foregroundColor: Colors.white,
icon: CupertinoIcons.delete,
label: S.of(context).delete,
),
],
);
}

View file

@ -37,7 +37,10 @@ class NodeHeaderListRow extends StandardListRow {
@override @override
Widget buildTrailing(BuildContext context) { Widget buildTrailing(BuildContext context) {
return Icon(Icons.add, return SizedBox(
color: Theme.of(context).accentTextTheme!.subtitle1!.color!, size: 24.0); width: 20,
child: Icon(Icons.add,
color: Theme.of(context).accentTextTheme!.subtitle1!.color!, size: 24.0),
);
} }
} }

View file

@ -1,4 +1,3 @@
import 'dart:ui';
import 'package:cake_wallet/entities/fiat_currency.dart'; import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator_icon.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator_icon.dart';
import 'package:cake_wallet/src/screens/send/widgets/send_card.dart'; import 'package:cake_wallet/src/screens/send/widgets/send_card.dart';
@ -6,8 +5,6 @@ import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/src/widgets/picker.dart'; import 'package:cake_wallet/src/widgets/picker.dart';
import 'package:cake_wallet/src/widgets/template_tile.dart'; import 'package:cake_wallet/src/widgets/template_tile.dart';
import 'package:cake_wallet/view_model/send/output.dart'; import 'package:cake_wallet/view_model/send/output.dart';
import 'package:cake_wallet/view_model/settings/settings_view_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
@ -28,13 +25,11 @@ import 'package:smooth_page_indicator/smooth_page_indicator.dart';
import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/crypto_currency.dart';
class SendPage extends BasePage { class SendPage extends BasePage {
SendPage({required this.sendViewModel,required this.settingsViewModel }) : _formKey = GlobalKey<FormState>(),fiatFromSettings = settingsViewModel.fiatCurrency; SendPage({required this.sendViewModel}) : _formKey = GlobalKey<FormState>();
final SendViewModel sendViewModel; final SendViewModel sendViewModel;
final SettingsViewModel settingsViewModel;
final GlobalKey<FormState> _formKey; final GlobalKey<FormState> _formKey;
final controller = PageController(initialPage: 0); final controller = PageController(initialPage: 0);
final FiatCurrency fiatFromSettings ;
bool _effectsInstalled = false; bool _effectsInstalled = false;
@ -55,7 +50,7 @@ class SendPage extends BasePage {
@override @override
void onClose(BuildContext context) { void onClose(BuildContext context) {
settingsViewModel.setFiatCurrency(fiatFromSettings); sendViewModel.onClose();
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
@ -236,7 +231,7 @@ class SendPage extends BasePage {
if(template.isCurrencySelected){ if(template.isCurrencySelected){
output.setCryptoAmount(template.amount); output.setCryptoAmount(template.amount);
}else{ }else{
settingsViewModel.setFiatCurrency(fiatFromTemplate); sendViewModel.setFiatCurrency(fiatFromTemplate);
output.setFiatAmount(template.amountFiat); output.setFiatAmount(template.amountFiat);
} }
output.resetParsedAddress(); output.resetParsedAddress();

View file

@ -1,11 +1,10 @@
import 'dart:ui'; import 'package:cake_wallet/entities/priority_for_wallet_type.dart';
import 'package:cake_wallet/utils/payment_request.dart'; import 'package:cake_wallet/utils/payment_request.dart';
import 'package:cw_core/transaction_priority.dart'; import 'package:cw_core/transaction_priority.dart';
import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/widgets/keyboard_done_button.dart'; import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
import 'package:cake_wallet/src/widgets/picker.dart'; import 'package:cake_wallet/src/widgets/picker.dart';
import 'package:cake_wallet/view_model/send/output.dart'; import 'package:cake_wallet/view_model/send/output.dart';
import 'package:cake_wallet/view_model/settings/settings_view_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';

View file

@ -0,0 +1,155 @@
import 'package:cake_wallet/src/screens/settings/widgets/settings_cell_with_arrow.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:cw_core/node.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/nodes/widgets/node_list_row.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/view_model/node_list/node_list_view_model.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
class ConnectionSyncPage extends BasePage {
ConnectionSyncPage(this.nodeListViewModel, this.dashboardViewModel);
@override
String get title => S.current.connection_sync;
final NodeListViewModel nodeListViewModel;
final DashboardViewModel dashboardViewModel;
@override
Widget body(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 10),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SettingsCellWithArrow(
title: S.current.reconnect,
handler: (context) => _presentReconnectAlert(context),
),
StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
SettingsCellWithArrow(
title: S.current.rescan,
handler: (context) => Navigator.of(context).pushNamed(Routes.rescan),
),
StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
NodeHeaderListRow(
title: S.of(context).add_new_node,
onTap: (_) async => await Navigator.of(context).pushNamed(Routes.newNode),
),
StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
SizedBox(height: 100),
Observer(
builder: (BuildContext context) {
return Flexible(
child: SectionStandardList(
sectionCount: 1,
context: context,
dividerPadding: EdgeInsets.symmetric(horizontal: 24),
itemCounter: (int sectionIndex) {
return nodeListViewModel.nodes.length;
},
itemBuilder: (_, sectionIndex, index) {
final node = nodeListViewModel.nodes[index];
final isSelected = node.keyIndex == nodeListViewModel.currentNode.keyIndex;
final nodeListRow = NodeListRow(
title: node.uriRaw,
isSelected: isSelected,
isAlive: node.requestNode(),
onTap: (_) async {
if (isSelected) {
return;
}
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
alertTitle: S.of(context).change_current_node_title,
alertContent: S.of(context).change_current_node(node.uriRaw),
leftButtonText: S.of(context).cancel,
rightButtonText: S.of(context).change,
actionLeftButton: () => Navigator.of(context).pop(),
actionRightButton: () async {
await nodeListViewModel.setAsCurrent(node);
Navigator.of(context).pop();
},
);
});
},
);
final dismissibleRow = Slidable(
key: Key('${node.keyIndex}'),
startActionPane: _actionPane(context, node),
endActionPane: _actionPane(context, node),
child: nodeListRow,
);
return isSelected ? nodeListRow : dismissibleRow;
},
),
);
},
),
],
),
);
}
Future<void> _presentReconnectAlert(BuildContext context) async {
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
alertTitle: S.of(context).reconnection,
alertContent: S.of(context).reconnect_alert_text,
rightButtonText: S.of(context).ok,
leftButtonText: S.of(context).cancel,
actionRightButton: () async {
Navigator.of(context).pop();
await dashboardViewModel.reconnect();
},
actionLeftButton: () => Navigator.of(context).pop());
},
);
}
ActionPane _actionPane(BuildContext context, Node node) => ActionPane(
motion: const ScrollMotion(),
extentRatio: 0.3,
children: [
SlidableAction(
onPressed: (context) async {
final confirmed = await showPopUp<bool>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
alertTitle: S.of(context).remove_node,
alertContent: S.of(context).remove_node_message,
rightButtonText: S.of(context).remove,
leftButtonText: S.of(context).cancel,
actionRightButton: () => Navigator.pop(context, true),
actionLeftButton: () => Navigator.pop(context, false));
}) ??
false;
if (confirmed) {
await nodeListViewModel.delete(node);
}
},
backgroundColor: Colors.red,
foregroundColor: Colors.white,
icon: CupertinoIcons.delete,
label: S.of(context).delete,
),
],
);
}

View file

@ -0,0 +1,80 @@
import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cake_wallet/entities/language_service.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_choices_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_picker_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/themes/theme_list.dart';
import 'package:cake_wallet/view_model/settings/choices_list_item.dart';
import 'package:cake_wallet/view_model/settings/display_settings_view_model.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
class DisplaySettingsPage extends BasePage {
DisplaySettingsPage(this._displaySettingsViewModel);
@override
String get title => S.current.display_settings;
final DisplaySettingsViewModel _displaySettingsViewModel;
@override
Widget body(BuildContext context) {
return Observer(builder: (_) {
return Container(
padding: EdgeInsets.only(top: 10),
child: Column(
children: [
SettingsSwitcherCell(
title: S.current.settings_display_balance,
value: _displaySettingsViewModel.shouldDisplayBalance,
onValueChange: (_, bool value) {
_displaySettingsViewModel.setShouldDisplayBalance(value);
}),
if (!isHaven)
SettingsPickerCell<FiatCurrency>(
title: S.current.settings_currency,
searchHintText: S.current.search_currency,
items: FiatCurrency.all,
selectedItem: _displaySettingsViewModel.fiatCurrency,
onItemSelected: (FiatCurrency currency) => _displaySettingsViewModel.setFiatCurrency(currency),
images: FiatCurrency.all.map((e) => Image.asset("assets/images/flags/${e.countryCode}.png")).toList(),
isGridView: true,
matchingCriteria: (FiatCurrency currency, String searchText) {
return currency.title.toLowerCase().contains(searchText) ||
currency.fullName.toLowerCase().contains(searchText);
},
),
SettingsPickerCell<String>(
title: S.current.settings_change_language,
searchHintText: S.current.search_language,
items: LanguageService.list.keys.toList(),
displayItem: (dynamic code) {
return LanguageService.list[code] ?? '';
},
selectedItem: _displaySettingsViewModel.languageCode,
onItemSelected: _displaySettingsViewModel.onLanguageSelected,
images: LanguageService.list.keys
.map((e) => Image.asset("assets/images/flags/${LanguageService.localeCountryCode[e]}.png"))
.toList(),
matchingCriteria: (String code, String searchText) {
return LanguageService.list[code]?.toLowerCase().contains(searchText) ?? false;
},
),
SettingsChoicesCell(
ChoicesListItem<ThemeBase>(
title: S.current.color_theme,
items: ThemeList.all,
selectedItem: _displaySettingsViewModel.theme,
onItemSelected: (ThemeBase theme) => _displaySettingsViewModel.setTheme(theme),
),
),
],
),
);
});
}
}

View file

@ -0,0 +1,45 @@
import 'package:cake_wallet/entities/priority_for_wallet_type.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_cell_with_arrow.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_picker_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_version_cell.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart';
import 'package:cake_wallet/view_model/settings/other_settings_view_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
class OtherSettingsPage extends BasePage {
OtherSettingsPage(this._otherSettingsViewModel);
@override
String get title => S.current.other_settings;
final OtherSettingsViewModel _otherSettingsViewModel;
@override
Widget body(BuildContext context) {
return Observer(builder: (_) {
return Container(
padding: EdgeInsets.only(top: 10),
child: Column(children: [
SettingsPickerCell(
title: S.current.settings_fee_priority,
items: priorityForWalletType(_otherSettingsViewModel.walletType),
displayItem: _otherSettingsViewModel.getDisplayPriority,
selectedItem: _otherSettingsViewModel.transactionPriority,
onItemSelected: _otherSettingsViewModel.onDisplayPrioritySelected,
),
SettingsCellWithArrow(
title: S.current.settings_terms_and_conditions,
handler: (BuildContext context) => Navigator.of(context).pushNamed(Routes.readDisclaimer),
),
StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
Spacer(),
SettingsVersionCell(title: S.of(context).version(_otherSettingsViewModel.currentVersion))
]),
);
});
}
}

View file

@ -0,0 +1,43 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
import 'package:cake_wallet/view_model/settings/privacy_settings_view_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
class PrivacyPage extends BasePage {
PrivacyPage(this._privacySettingsViewModel);
@override
String get title => S.current.privacy_settings;
final PrivacySettingsViewModel _privacySettingsViewModel;
@override
Widget body(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 10),
child: Observer(builder: (_) {
return Observer(builder: (_) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
SettingsSwitcherCell(
title: S.current.disable_exchange,
value: _privacySettingsViewModel.disableExchange,
onValueChange: (BuildContext context, bool value) {
_privacySettingsViewModel.setEnableExchange(value);
}),
SettingsSwitcherCell(
title: S.current.settings_save_recipient_address,
value: _privacySettingsViewModel.shouldSaveRecipientAddress,
onValueChange: (BuildContext _, bool value) {
_privacySettingsViewModel.setShouldSaveRecipientAddress(value);
})
],
);
});
}),
);
}
}

View file

@ -0,0 +1,84 @@
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/pin_code/pin_code_widget.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_cell_with_arrow.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart';
import 'package:cake_wallet/view_model/settings/security_settings_view_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
class SecurityBackupPage extends BasePage {
SecurityBackupPage(this._securitySettingsViewModel);
@override
String get title => S.current.security_and_backup;
final SecuritySettingsViewModel _securitySettingsViewModel;
@override
Widget body(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 10),
child: Column(mainAxisSize: MainAxisSize.min, children: [
SettingsCellWithArrow(
title: S.current.show_keys,
handler: (_) => Navigator.of(context).pushNamed(Routes.auth,
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) {
if (isAuthenticatedSuccessfully) {
auth.close(route: Routes.showKeys);
}
}),
),
StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
SettingsCellWithArrow(
title: S.current.create_backup,
handler: (_) => Navigator.of(context).pushNamed(Routes.auth,
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) {
if (isAuthenticatedSuccessfully) {
auth.close(route: Routes.backup);
}
}),
),
StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
SettingsCellWithArrow(
title: S.current.settings_change_pin,
handler: (_) => Navigator.of(context).pushNamed(Routes.auth,
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) {
auth.close(
route: isAuthenticatedSuccessfully ? Routes.setupPin : null,
arguments: (PinCodeState<PinCodeWidget> setupPinContext, String _) {
setupPinContext.close();
},
);
})),
StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
Observer(builder: (_) {
return SettingsSwitcherCell(
title: S.current.settings_allow_biometrical_authentication,
value: _securitySettingsViewModel.allowBiometricalAuthentication,
onValueChange: (BuildContext context, bool value) {
if (value) {
Navigator.of(context).pushNamed(Routes.auth,
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) async {
if (isAuthenticatedSuccessfully) {
if (await _securitySettingsViewModel.biometricAuthenticated()) {
_securitySettingsViewModel.setAllowBiometricalAuthentication(isAuthenticatedSuccessfully);
}
} else {
_securitySettingsViewModel.setAllowBiometricalAuthentication(isAuthenticatedSuccessfully);
}
auth.close();
});
} else {
_securitySettingsViewModel.setAllowBiometricalAuthentication(value);
}
});
}),
]),
);
}
}

View file

@ -1,98 +0,0 @@
import 'package:cake_wallet/src/screens/settings/widgets/settings_choices_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_version_cell.dart';
import 'package:cake_wallet/view_model/settings/choices_list_item.dart';
import 'package:cake_wallet/view_model/settings/version_list_item.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/view_model/settings/settings_view_model.dart';
import 'package:cake_wallet/view_model/settings/link_list_item.dart';
import 'package:cake_wallet/view_model/settings/picker_list_item.dart';
import 'package:cake_wallet/view_model/settings/regular_list_item.dart';
import 'package:cake_wallet/view_model/settings/switcher_list_item.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_link_provider_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_cell_with_arrow.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_picker_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
class SettingsPage extends BasePage {
SettingsPage(this.settingsViewModel);
final SettingsViewModel settingsViewModel;
@override
String get title => S.current.settings_title;
@override
Widget body(BuildContext context) {
// FIX-ME: Added `context` it was not used here before, maby bug ?
return SectionStandardList(
context: context,
sectionCount: settingsViewModel.sections.length,
itemCounter: (int sectionIndex) {
if (sectionIndex < settingsViewModel.sections.length) {
return settingsViewModel.sections[sectionIndex].length;
}
return 0;
},
itemBuilder: (_, sectionIndex, itemIndex) {
final item = settingsViewModel.sections[sectionIndex][itemIndex];
if (item is PickerListItem) {
return Observer(builder: (_) {
return SettingsPickerCell<Object>(
displayItem: item.displayItem,
title: item.title,
selectedItem: item.selectedItem(),
items: item.items,
onItemSelected: (dynamic value) => item.onItemSelected(value),
images: item.images,
searchHintText: item.searchHintText,
isGridView: item.isGridView,
matchingCriteria: (dynamic value, String searchText) => item.matchingCriteria(value, searchText),
);
});
}
if (item is SwitcherListItem) {
return Observer(builder: (_) {
return SettingsSwitcherCell(
title: item.title,
value: item.value(),
onValueChange: item.onValueChange);
});
}
if (item is RegularListItem) {
return SettingsCellWithArrow(
title: item.title, handler: item.handler);
}
if (item is LinkListItem) {
return SettingsLinkProviderCell(
title: item.title,
icon: item.icon,
link: item.link,
linkTitle: item.linkTitle);
}
if (item is VersionListItem) {
return Observer(builder: (_) {
return SettingsVersionCell(
title:
S.of(context).version(settingsViewModel.currentVersion));
});
}
if (item is ChoicesListItem) {
return SettingsChoicesCell(item);
}
return Container();
});
}
}

View file

@ -123,6 +123,7 @@ class SectionStandardList extends StatelessWidget {
required this.itemBuilder, required this.itemBuilder,
required this.sectionCount, required this.sectionCount,
required BuildContext context, required BuildContext context,
this.dividerPadding = const EdgeInsets.only(left: 24),
this.themeColor, this.themeColor,
this.dividerThemeColor, this.dividerThemeColor,
this.sectionTitleBuilder, this.sectionTitleBuilder,
@ -149,6 +150,7 @@ class SectionStandardList extends StatelessWidget {
final List<Widget> totalRows; final List<Widget> totalRows;
final Color? themeColor; final Color? themeColor;
final Color? dividerThemeColor; final Color? dividerThemeColor;
final EdgeInsets dividerPadding;
List<Widget> transform( List<Widget> transform(
bool hasTopSeparator, bool hasTopSeparator,
@ -178,7 +180,7 @@ class SectionStandardList extends StatelessWidget {
items.add(sectionIndex + 1 != sectionCount items.add(sectionIndex + 1 != sectionCount
? SectionHeaderListRow() ? SectionHeaderListRow()
: StandardListSeparator(padding: EdgeInsets.only(left: 24))); : StandardListSeparator(padding: dividerPadding));
} }
return items; return items;

View file

@ -30,6 +30,7 @@ abstract class SettingsStoreBase with Store {
required BalanceDisplayMode initialBalanceDisplayMode, required BalanceDisplayMode initialBalanceDisplayMode,
required bool initialSaveRecipientAddress, required bool initialSaveRecipientAddress,
required bool initialAllowBiometricalAuthentication, required bool initialAllowBiometricalAuthentication,
required bool initialExchangeEnabled,
required ThemeBase initialTheme, required ThemeBase initialTheme,
required int initialPinLength, required int initialPinLength,
required String initialLanguageCode, required String initialLanguageCode,
@ -47,6 +48,7 @@ abstract class SettingsStoreBase with Store {
balanceDisplayMode = initialBalanceDisplayMode, balanceDisplayMode = initialBalanceDisplayMode,
shouldSaveRecipientAddress = initialSaveRecipientAddress, shouldSaveRecipientAddress = initialSaveRecipientAddress,
allowBiometricalAuthentication = initialAllowBiometricalAuthentication, allowBiometricalAuthentication = initialAllowBiometricalAuthentication,
disableExchange = initialExchangeEnabled,
currentTheme = initialTheme, currentTheme = initialTheme,
pinCodeLength = initialPinLength, pinCodeLength = initialPinLength,
languageCode = initialLanguageCode, languageCode = initialLanguageCode,
@ -143,6 +145,9 @@ abstract class SettingsStoreBase with Store {
@observable @observable
bool allowBiometricalAuthentication; bool allowBiometricalAuthentication;
@observable
bool disableExchange;
@observable @observable
ThemeBase currentTheme; ThemeBase currentTheme;
@ -221,6 +226,8 @@ abstract class SettingsStoreBase with Store {
final allowBiometricalAuthentication = sharedPreferences final allowBiometricalAuthentication = sharedPreferences
.getBool(PreferencesKey.allowBiometricalAuthenticationKey) ?? .getBool(PreferencesKey.allowBiometricalAuthenticationKey) ??
false; false;
final disableExchange = sharedPreferences
.getBool(PreferencesKey.disableExchangeKey) ?? false;
final legacyTheme = final legacyTheme =
(sharedPreferences.getBool(PreferencesKey.isDarkThemeLegacy) ?? false) (sharedPreferences.getBool(PreferencesKey.isDarkThemeLegacy) ?? false)
? ThemeType.dark.index ? ThemeType.dark.index
@ -284,6 +291,7 @@ abstract class SettingsStoreBase with Store {
initialBalanceDisplayMode: currentBalanceDisplayMode, initialBalanceDisplayMode: currentBalanceDisplayMode,
initialSaveRecipientAddress: shouldSaveRecipientAddress, initialSaveRecipientAddress: shouldSaveRecipientAddress,
initialAllowBiometricalAuthentication: allowBiometricalAuthentication, initialAllowBiometricalAuthentication: allowBiometricalAuthentication,
initialExchangeEnabled: disableExchange,
initialTheme: savedTheme, initialTheme: savedTheme,
actionlistDisplayMode: actionListDisplayMode, actionlistDisplayMode: actionListDisplayMode,
initialPinLength: pinLength, initialPinLength: pinLength,

View file

@ -53,7 +53,6 @@ abstract class DashboardViewModelBase with Store {
hasBuyAction = false, hasBuyAction = false,
isEnabledBuyAction = false, isEnabledBuyAction = false,
hasExchangeAction = false, hasExchangeAction = false,
isEnabledExchangeAction = false,
isShowFirstYatIntroduction = false, isShowFirstYatIntroduction = false,
isShowSecondYatIntroduction = false, isShowSecondYatIntroduction = false,
isShowThirdYatIntroduction = false, isShowThirdYatIntroduction = false,
@ -249,8 +248,8 @@ abstract class DashboardViewModelBase with Store {
void furtherShowYatPopup(bool shouldShow) => void furtherShowYatPopup(bool shouldShow) =>
settingsStore.shouldShowYatPopup = shouldShow; settingsStore.shouldShowYatPopup = shouldShow;
@observable @computed
bool isEnabledExchangeAction; bool get isEnabledExchangeAction => !settingsStore.disableExchange;
@observable @observable
bool hasExchangeAction; bool hasExchangeAction;
@ -365,7 +364,6 @@ abstract class DashboardViewModelBase with Store {
} }
void updateActions() { void updateActions() {
isEnabledExchangeAction = true;
hasExchangeAction = !isHaven; hasExchangeAction = !isHaven;
isEnabledBuyAction = wallet.type != WalletType.haven isEnabledBuyAction = wallet.type != WalletType.haven
&& wallet.type != WalletType.monero; && wallet.type != WalletType.monero;

View file

@ -6,9 +6,8 @@ import 'package:cake_wallet/entities/preferences_key.dart';
import 'package:cake_wallet/exchange/sideshift/sideshift_exchange_provider.dart'; import 'package:cake_wallet/exchange/sideshift/sideshift_exchange_provider.dart';
import 'package:cake_wallet/exchange/sideshift/sideshift_request.dart'; import 'package:cake_wallet/exchange/sideshift/sideshift_request.dart';
import 'package:cake_wallet/exchange/simpleswap/simpleswap_exchange_provider.dart'; import 'package:cake_wallet/exchange/simpleswap/simpleswap_exchange_provider.dart';
import 'package:cake_wallet/view_model/settings/settings_view_model.dart';
import 'package:cw_core/transaction_priority.dart';
import 'package:cake_wallet/exchange/simpleswap/simpleswap_request.dart'; import 'package:cake_wallet/exchange/simpleswap/simpleswap_request.dart';
import 'package:cw_core/transaction_priority.dart';
import 'package:cw_core/wallet_base.dart'; import 'package:cw_core/wallet_base.dart';
import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/sync_status.dart'; import 'package:cw_core/sync_status.dart';
@ -43,7 +42,7 @@ class ExchangeViewModel = ExchangeViewModelBase with _$ExchangeViewModel;
abstract class ExchangeViewModelBase with Store { abstract class ExchangeViewModelBase with Store {
ExchangeViewModelBase(this.wallet, this.trades, this._exchangeTemplateStore, ExchangeViewModelBase(this.wallet, this.trades, this._exchangeTemplateStore,
this.tradesStore, this._settingsStore, this.sharedPreferences, this._settingsViewModel) this.tradesStore, this._settingsStore, this.sharedPreferences)
: _cryptoNumberFormat = NumberFormat(), : _cryptoNumberFormat = NumberFormat(),
isReverse = false, isReverse = false,
isFixedRateMode = false, isFixedRateMode = false,
@ -190,6 +189,19 @@ abstract class ExchangeViewModelBase with Store {
ObservableList<ExchangeTemplate> get templates => ObservableList<ExchangeTemplate> get templates =>
_exchangeTemplateStore.templates; _exchangeTemplateStore.templates;
@computed
TransactionPriority get transactionPriority {
final priority = _settingsStore.priority[wallet.type];
if (priority == null) {
throw Exception('Unexpected type ${wallet.type.toString()}');
}
return priority;
}
bool get hasAllAmount => bool get hasAllAmount =>
wallet.type == WalletType.bitcoin && depositCurrency == wallet.currency; wallet.type == WalletType.bitcoin && depositCurrency == wallet.currency;
@ -199,11 +211,11 @@ abstract class ExchangeViewModelBase with Store {
switch (wallet.type) { switch (wallet.type) {
case WalletType.monero: case WalletType.monero:
case WalletType.haven: case WalletType.haven:
return _settingsViewModel.transactionPriority == monero!.getMoneroTransactionPrioritySlow(); return transactionPriority == monero!.getMoneroTransactionPrioritySlow();
case WalletType.bitcoin: case WalletType.bitcoin:
return _settingsViewModel.transactionPriority == bitcoin!.getBitcoinTransactionPrioritySlow(); return transactionPriority == bitcoin!.getBitcoinTransactionPrioritySlow();
case WalletType.litecoin: case WalletType.litecoin:
return _settingsViewModel.transactionPriority == bitcoin!.getLitecoinTransactionPrioritySlow(); return transactionPriority == bitcoin!.getLitecoinTransactionPrioritySlow();
default: default:
return false; return false;
} }
@ -221,8 +233,6 @@ abstract class ExchangeViewModelBase with Store {
final SettingsStore _settingsStore; final SettingsStore _settingsStore;
final SettingsViewModel _settingsViewModel;
double _bestRate = 0.0; double _bestRate = 0.0;
late Timer bestRateSync; late Timer bestRateSync;
@ -375,6 +385,7 @@ abstract class ExchangeViewModelBase with Store {
TradeRequest? request; TradeRequest? request;
String amount = ''; String amount = '';
try {
for (var provider in _sortedAvailableProviders.values) { for (var provider in _sortedAvailableProviders.values) {
if (!(await provider.checkIsAvailable())) { if (!(await provider.checkIsAvailable())) {
continue; continue;
@ -465,6 +476,14 @@ abstract class ExchangeViewModelBase with Store {
tradeState = TradeIsCreatedFailure( tradeState = TradeIsCreatedFailure(
title: S.current.trade_not_created, title: S.current.trade_not_created,
error: S.current.none_of_selected_providers_can_exchange); error: S.current.none_of_selected_providers_can_exchange);
} on ConcurrentModificationError {
/// if create trade happened at the exact same time of the scheduled rate update
/// then delay the create trade a bit and try again
///
/// this is because the limitation of the SplayTreeMap that
/// you can't modify it while iterating through it
Future.delayed(Duration(milliseconds: 500), createTrade);
}
} }
@action @action

View file

@ -1,10 +1,11 @@
import 'package:cake_wallet/entities/balance_display_mode.dart';
import 'package:cake_wallet/entities/priority_for_wallet_type.dart';
import 'package:cake_wallet/entities/format_amount.dart'; import 'package:cake_wallet/entities/format_amount.dart';
import 'package:cake_wallet/entities/transaction_description.dart'; import 'package:cake_wallet/entities/transaction_description.dart';
import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart'; import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart';
import 'package:cw_core/transaction_priority.dart'; import 'package:cw_core/transaction_priority.dart';
import 'package:cake_wallet/view_model/send/output.dart'; import 'package:cake_wallet/view_model/send/output.dart';
import 'package:cake_wallet/view_model/send/send_template_view_model.dart'; import 'package:cake_wallet/view_model/send/send_template_view_model.dart';
import 'package:cake_wallet/view_model/settings/settings_view_model.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:cake_wallet/entities/template.dart'; import 'package:cake_wallet/entities/template.dart';
@ -43,7 +44,8 @@ abstract class SendViewModelBase with Store {
: state = InitialExecutionState(), : state = InitialExecutionState(),
currencies = _wallet.balance.keys.toList(), currencies = _wallet.balance.keys.toList(),
selectedCryptoCurrency = _wallet.currency, selectedCryptoCurrency = _wallet.currency,
outputs = ObservableList<Output>() { outputs = ObservableList<Output>(),
fiatFromSettings = _settingsStore.fiatCurrency {
final priority = _settingsStore.priority[_wallet.type]; final priority = _settingsStore.priority[_wallet.type];
final priorities = priorityForWalletType(_wallet.type); final priorities = priorityForWalletType(_wallet.type);
@ -142,11 +144,13 @@ abstract class SendViewModelBase with Store {
Validator get textValidator => TextValidator(); Validator get textValidator => TextValidator();
final FiatCurrency fiatFromSettings;
@observable @observable
PendingTransaction? pendingTransaction; PendingTransaction? pendingTransaction;
@computed @computed
String get balance => balanceViewModel.availableBalance ?? '0.0'; String get balance => balanceViewModel.availableBalance;
@computed @computed
bool get isReadyForSend => _wallet.syncStatus is SyncedSyncStatus; bool get isReadyForSend => _wallet.syncStatus is SyncedSyncStatus;
@ -175,6 +179,9 @@ abstract class SendViewModelBase with Store {
bool get hasCurrecyChanger => walletType == WalletType.haven; bool get hasCurrecyChanger => walletType == WalletType.haven;
@computed
FiatCurrency get fiatCurrency => _settingsStore.fiatCurrency;
final WalletBase _wallet; final WalletBase _wallet;
final SettingsStore _settingsStore; final SettingsStore _settingsStore;
final SendTemplateViewModel sendTemplateViewModel; final SendTemplateViewModel sendTemplateViewModel;
@ -217,7 +224,7 @@ abstract class SendViewModelBase with Store {
state = TransactionCommitting(); state = TransactionCommitting();
await pendingTransaction!.commit(); await pendingTransaction!.commit();
if (pendingTransaction!.id?.isNotEmpty ?? false) { if (pendingTransaction!.id.isNotEmpty) {
_settingsStore.shouldSaveRecipientAddress _settingsStore.shouldSaveRecipientAddress
? await transactionDescriptionBox.add(TransactionDescription( ? await transactionDescriptionBox.add(TransactionDescription(
id: pendingTransaction!.id, id: pendingTransaction!.id,
@ -293,6 +300,14 @@ abstract class SendViewModelBase with Store {
bool _isEqualCurrency(String currency) => bool _isEqualCurrency(String currency) =>
currency.toLowerCase() == _wallet.currency.title.toLowerCase(); currency.toLowerCase() == _wallet.currency.title.toLowerCase();
@action
void onClose() =>
_settingsStore.fiatCurrency = fiatFromSettings;
@action
void setFiatCurrency(FiatCurrency fiat) =>
_settingsStore.fiatCurrency = fiat;
void estimateFee() { void estimateFee() {
_wallet.feeEstimate.update(priority: _settingsStore.priority[_wallet.type]!, outputsCount: outputs.length); _wallet.feeEstimate.update(priority: _settingsStore.priority[_wallet.type]!, outputsCount: outputs.length);
} }

View file

@ -0,0 +1,57 @@
import 'package:cake_wallet/entities/balance_display_mode.dart';
import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:mobx/mobx.dart';
part 'display_settings_view_model.g.dart';
class DisplaySettingsViewModel = DisplaySettingsViewModelBase with _$DisplaySettingsViewModel;
abstract class DisplaySettingsViewModelBase with Store {
DisplaySettingsViewModelBase(
this._settingsStore,
);
final SettingsStore _settingsStore;
@computed
FiatCurrency get fiatCurrency => _settingsStore.fiatCurrency;
@computed
String get languageCode => _settingsStore.languageCode;
@computed
BalanceDisplayMode get balanceDisplayMode => _settingsStore.balanceDisplayMode;
@computed
bool get shouldDisplayBalance => balanceDisplayMode == BalanceDisplayMode.displayableBalance;
@computed
ThemeBase get theme => _settingsStore.currentTheme;
@action
void setBalanceDisplayMode(BalanceDisplayMode value) => _settingsStore.balanceDisplayMode = value;
@action
void setShouldDisplayBalance(bool value) {
if (value) {
_settingsStore.balanceDisplayMode = BalanceDisplayMode.displayableBalance;
} else {
_settingsStore.balanceDisplayMode = BalanceDisplayMode.hiddenBalance;
}
}
@action
void onLanguageSelected(String code) {
_settingsStore.languageCode = code;
}
@action
void setTheme(ThemeBase newTheme) {
_settingsStore.currentTheme = newTheme;
}
@action
void setFiatCurrency(FiatCurrency value) => _settingsStore.fiatCurrency = value;
}

View file

@ -0,0 +1,64 @@
import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cake_wallet/entities/priority_for_wallet_type.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cw_core/balance.dart';
import 'package:cw_core/transaction_history.dart';
import 'package:cw_core/transaction_info.dart';
import 'package:cw_core/transaction_priority.dart';
import 'package:cw_core/wallet_base.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:mobx/mobx.dart';
import 'package:package_info/package_info.dart';
part 'other_settings_view_model.g.dart';
class OtherSettingsViewModel = OtherSettingsViewModelBase with _$OtherSettingsViewModel;
abstract class OtherSettingsViewModelBase with Store {
OtherSettingsViewModelBase(this._settingsStore, this._wallet)
: walletType = _wallet.type,
currentVersion = '' {
PackageInfo.fromPlatform()
.then((PackageInfo packageInfo) => currentVersion = packageInfo.version);
final priority = _settingsStore.priority[_wallet.type];
final priorities = priorityForWalletType(_wallet.type);
if (!priorities.contains(priority)) {
_settingsStore.priority[_wallet.type] = priorities.first;
}
}
final WalletType walletType;
final WalletBase<Balance, TransactionHistoryBase<TransactionInfo>, TransactionInfo> _wallet;
@observable
String currentVersion;
final SettingsStore _settingsStore;
@computed
TransactionPriority get transactionPriority {
final priority = _settingsStore.priority[walletType];
if (priority == null) {
throw Exception('Unexpected type ${walletType.toString()}');
}
return priority;
}
String getDisplayPriority(dynamic priority) {
final _priority = priority as TransactionPriority;
if (_wallet.type == WalletType.bitcoin || _wallet.type == WalletType.litecoin) {
final rate = bitcoin!.getFeeRate(_wallet, _priority);
return bitcoin!.bitcoinTransactionPriorityWithLabel(_priority, rate);
}
return priority.toString();
}
void onDisplayPrioritySelected(TransactionPriority priority) =>
_settingsStore.priority[_wallet.type] = priority;
}

View file

@ -0,0 +1,24 @@
import 'package:cake_wallet/store/settings_store.dart';
import 'package:mobx/mobx.dart';
part 'privacy_settings_view_model.g.dart';
class PrivacySettingsViewModel = PrivacySettingsViewModelBase with _$PrivacySettingsViewModel;
abstract class PrivacySettingsViewModelBase with Store {
PrivacySettingsViewModelBase(this._settingsStore);
final SettingsStore _settingsStore;
@computed
bool get disableExchange => _settingsStore.disableExchange;
@computed
bool get shouldSaveRecipientAddress => _settingsStore.shouldSaveRecipientAddress;
@action
void setShouldSaveRecipientAddress(bool value) => _settingsStore.shouldSaveRecipientAddress = value;
@action
void setEnableExchange(bool value) => _settingsStore.disableExchange = value;
}

View file

@ -0,0 +1,25 @@
import 'package:cake_wallet/entities/biometric_auth.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:mobx/mobx.dart';
part 'security_settings_view_model.g.dart';
class SecuritySettingsViewModel = SecuritySettingsViewModelBase with _$SecuritySettingsViewModel;
abstract class SecuritySettingsViewModelBase with Store {
SecuritySettingsViewModelBase(this._settingsStore) : _biometricAuth = BiometricAuth();
final BiometricAuth _biometricAuth;
final SettingsStore _settingsStore;
@computed
bool get allowBiometricalAuthentication => _settingsStore.allowBiometricalAuthentication;
@action
Future<bool> biometricAuthenticated() async {
return await _biometricAuth.canCheckBiometrics() && await _biometricAuth.isAuthenticated();
}
@action
void setAllowBiometricalAuthentication(bool value) => _settingsStore.allowBiometricalAuthentication = value;
}

View file

@ -1,336 +0,0 @@
import 'package:cake_wallet/entities/language_service.dart';
import 'package:cake_wallet/store/yat/yat_store.dart';
import 'package:cake_wallet/view_model/settings/choices_list_item.dart';
import 'package:flutter/cupertino.dart';
import 'package:mobx/mobx.dart';
import 'package:package_info/package_info.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cw_core/wallet_base.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/entities/biometric_auth.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:cake_wallet/entities/balance_display_mode.dart';
import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cw_core/node.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/haven/haven.dart';
import 'package:cake_wallet/entities/action_list_display_mode.dart';
import 'package:cake_wallet/view_model/settings/version_list_item.dart';
import 'package:cake_wallet/view_model/settings/picker_list_item.dart';
import 'package:cake_wallet/view_model/settings/regular_list_item.dart';
import 'package:cake_wallet/view_model/settings/settings_list_item.dart';
import 'package:cake_wallet/view_model/settings/switcher_list_item.dart';
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cw_core/transaction_history.dart';
import 'package:cw_core/balance.dart';
import 'package:cw_core/transaction_info.dart';
import 'package:cw_core/transaction_priority.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/themes/theme_list.dart';
import 'package:cake_wallet/src/screens/pin_code/pin_code_widget.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
part 'settings_view_model.g.dart';
class SettingsViewModel = SettingsViewModelBase with _$SettingsViewModel;
List<TransactionPriority> priorityForWalletType(WalletType type) {
switch (type) {
case WalletType.monero:
return monero!.getTransactionPriorities();
case WalletType.bitcoin:
return bitcoin!.getTransactionPriorities();
case WalletType.litecoin:
return bitcoin!.getLitecoinTransactionPriorities();
case WalletType.haven:
return haven!.getTransactionPriorities();
default:
return [];
}
}
abstract class SettingsViewModelBase with Store {
SettingsViewModelBase(
this._settingsStore,
this._yatStore,
WalletBase<Balance, TransactionHistoryBase<TransactionInfo>,
TransactionInfo>
wallet)
: itemHeaders = {},
_walletType = wallet.type,
_biometricAuth = BiometricAuth(),
sections = <List<SettingsListItem>>[],
currentVersion = '' {
PackageInfo.fromPlatform().then(
(PackageInfo packageInfo) => currentVersion = packageInfo.version);
final priority = _settingsStore.priority[wallet.type];
final priorities = priorityForWalletType(wallet.type);
if (!priorities.contains(priority)) {
_settingsStore.priority[wallet.type] = priorities.first;
}
//var connectYatUrl = YatLink.baseUrl + YatLink.signInSuffix;
//final connectYatUrlParameters =
// _yatStore.defineQueryParameters();
//if (connectYatUrlParameters.isNotEmpty) {
// connectYatUrl += YatLink.queryParameter + connectYatUrlParameters;
//}
//var manageYatUrl = YatLink.baseUrl + YatLink.managePath;
//final manageYatUrlParameters =
// _yatStore.defineQueryParameters();
//if (manageYatUrlParameters.isNotEmpty) {
// manageYatUrl += YatLink.queryParameter + manageYatUrlParameters;
//}
//var createNewYatUrl = YatLink.startFlowUrl;
//final createNewYatUrlParameters =
// _yatStore.defineQueryParameters();
//if (createNewYatUrlParameters.isNotEmpty) {
// createNewYatUrl += '?sub1=' + createNewYatUrlParameters;
//}
sections = [
[
SwitcherListItem(
title: S.current.settings_display_balance,
value: () => balanceDisplayMode == BalanceDisplayMode.displayableBalance,
onValueChange: (_, bool value) {
if (value) {
_settingsStore.balanceDisplayMode = BalanceDisplayMode.displayableBalance;
} else {
_settingsStore.balanceDisplayMode = BalanceDisplayMode.hiddenBalance;
}
},
),
if (!isHaven)
PickerListItem(
title: S.current.settings_currency,
searchHintText: S.current.search_currency,
items: FiatCurrency.all,
selectedItem: () => fiatCurrency,
onItemSelected: (FiatCurrency currency) =>
setFiatCurrency(currency),
images: FiatCurrency.all.map(
(e) => Image.asset("assets/images/flags/${e.countryCode}.png"))
.toList(),
isGridView: true,
matchingCriteria: (FiatCurrency currency, String searchText) {
return currency.title.toLowerCase().contains(searchText) || currency.fullName.toLowerCase().contains(searchText);
},
),
PickerListItem(
title: S.current.settings_fee_priority,
items: priorityForWalletType(wallet.type),
displayItem: (dynamic priority) {
final _priority = priority as TransactionPriority;
if (wallet.type == WalletType.bitcoin
|| wallet.type == WalletType.litecoin) {
final rate = bitcoin!.getFeeRate(wallet, _priority);
return bitcoin!.bitcoinTransactionPriorityWithLabel(_priority, rate);
}
return priority.toString();
},
selectedItem: () => transactionPriority,
onItemSelected: (TransactionPriority priority) =>
_settingsStore.priority[wallet.type] = priority),
SwitcherListItem(
title: S.current.settings_save_recipient_address,
value: () => shouldSaveRecipientAddress,
onValueChange: (_, bool value) =>
setShouldSaveRecipientAddress(value))
],
[
RegularListItem(
title: S.current.settings_change_pin,
handler: (BuildContext context) {
Navigator.of(context).pushNamed(Routes.auth, arguments:
(bool isAuthenticatedSuccessfully, AuthPageState auth) {
auth.close(
route: isAuthenticatedSuccessfully ? Routes.setupPin : null,
arguments: (PinCodeState<PinCodeWidget> setupPinContext,
String _) {
setupPinContext.close();
},
);
});
}),
PickerListItem(
title: S.current.settings_change_language,
searchHintText: S.current.search_language,
items: LanguageService.list.keys.toList(),
displayItem: (dynamic code) {
return LanguageService.list[code] ?? '';
},
selectedItem: () => _settingsStore.languageCode,
onItemSelected: (String code) {
_settingsStore.languageCode = code;
},
images: LanguageService.list.keys.map(
(e) => Image.asset("assets/images/flags/${LanguageService.localeCountryCode[e]}.png"))
.toList(),
matchingCriteria: (String code, String searchText) {
return LanguageService.list[code]?.toLowerCase().contains(searchText) ?? false;
},
),
SwitcherListItem(
title: S.current.settings_allow_biometrical_authentication,
value: () => allowBiometricalAuthentication,
onValueChange: (BuildContext context, bool value) {
if (value) {
Navigator.of(context).pushNamed(Routes.auth, arguments:
(bool isAuthenticatedSuccessfully,
AuthPageState auth) async {
if (isAuthenticatedSuccessfully) {
if (await _biometricAuth.canCheckBiometrics() &&
await _biometricAuth.isAuthenticated()) {
setAllowBiometricalAuthentication(
isAuthenticatedSuccessfully);
}
} else {
setAllowBiometricalAuthentication(
isAuthenticatedSuccessfully);
}
auth.close();
});
} else {
setAllowBiometricalAuthentication(value);
}
}),
ChoicesListItem(
title: S.current.color_theme,
items: ThemeList.all,
selectedItem: theme,
onItemSelected: (ThemeBase theme) => _settingsStore.currentTheme = theme,
),
],
//[
//if (_yatStore.emoji.isNotEmpty) ...[
// LinkListItem(
// title: S.current.manage_yats,
// link: manageYatUrl,
// linkTitle: ''),
//] else ...[
//LinkListItem(
// title: S.current.connect_yats,
// link: connectYatUrl,
// linkTitle: ''),
//LinkListItem(
// title: 'Create new Yats',
// link: createNewYatUrl,
// linkTitle: '')
//]
//],
[
RegularListItem(
title: S.current.settings_terms_and_conditions,
handler: (BuildContext context) =>
Navigator.of(context).pushNamed(Routes.readDisclaimer),
)
],
[VersionListItem(title: currentVersion)]
];
}
@observable
String currentVersion;
@computed
Node get node => _settingsStore.getCurrentNode(_walletType);
@computed
FiatCurrency get fiatCurrency => _settingsStore.fiatCurrency;
@computed
ObservableList<ActionListDisplayMode> get actionlistDisplayMode =>
_settingsStore.actionlistDisplayMode;
@computed
TransactionPriority get transactionPriority {
final priority = _settingsStore.priority[_walletType];
if (priority == null) {
throw Exception('Unexpected type ${_walletType.toString()}');
}
return priority;
}
@computed
BalanceDisplayMode get balanceDisplayMode =>
_settingsStore.balanceDisplayMode;
@computed
bool get shouldSaveRecipientAddress =>
_settingsStore.shouldSaveRecipientAddress;
@computed
bool get allowBiometricalAuthentication =>
_settingsStore.allowBiometricalAuthentication;
@computed
ThemeBase get theme => _settingsStore.currentTheme;
bool get isBitcoinBuyEnabled => _settingsStore.isBitcoinBuyEnabled;
final Map<String, String> itemHeaders;
List<List<SettingsListItem>> sections;
final SettingsStore _settingsStore;
final YatStore _yatStore;
final WalletType _walletType;
final BiometricAuth _biometricAuth;
@action
void setBalanceDisplayMode(BalanceDisplayMode value) =>
_settingsStore.balanceDisplayMode = value;
@action
void setFiatCurrency(FiatCurrency value) =>
_settingsStore.fiatCurrency = value;
@action
void setShouldSaveRecipientAddress(bool value) =>
_settingsStore.shouldSaveRecipientAddress = value;
@action
void setAllowBiometricalAuthentication(bool value) =>
_settingsStore.allowBiometricalAuthentication = value;
@action
void toggleTransactionsDisplay() =>
actionlistDisplayMode.contains(ActionListDisplayMode.transactions)
? _hideTransaction()
: _showTransaction();
@action
void toggleTradesDisplay() =>
actionlistDisplayMode.contains(ActionListDisplayMode.trades)
? _hideTrades()
: _showTrades();
@action
void _hideTransaction() =>
actionlistDisplayMode.remove(ActionListDisplayMode.transactions);
@action
void _hideTrades() =>
actionlistDisplayMode.remove(ActionListDisplayMode.trades);
@action
void _showTransaction() =>
actionlistDisplayMode.add(ActionListDisplayMode.transactions);
@action
void _showTrades() => actionlistDisplayMode.add(ActionListDisplayMode.trades);
}

View file

@ -184,7 +184,7 @@ abstract class TransactionDetailsViewModelBase with Store {
case WalletType.monero: case WalletType.monero:
return 'https://monero.com/tx/${txId}'; return 'https://monero.com/tx/${txId}';
case WalletType.bitcoin: case WalletType.bitcoin:
return 'https://www.blockchain.com/btc/tx/${txId}'; return 'https://mempool.space/tx/${txId}';
case WalletType.litecoin: case WalletType.litecoin:
return 'https://blockchair.com/litecoin/transaction/${txId}'; return 'https://blockchair.com/litecoin/transaction/${txId}';
case WalletType.haven: case WalletType.haven:
@ -199,7 +199,7 @@ abstract class TransactionDetailsViewModelBase with Store {
case WalletType.monero: case WalletType.monero:
return S.current.view_transaction_on + 'Monero.com'; return S.current.view_transaction_on + 'Monero.com';
case WalletType.bitcoin: case WalletType.bitcoin:
return S.current.view_transaction_on + 'Blockchain.com'; return S.current.view_transaction_on + 'mempool.space';
case WalletType.litecoin: case WalletType.litecoin:
return S.current.view_transaction_on + 'Blockchair.com'; return S.current.view_transaction_on + 'Blockchair.com';
case WalletType.haven: case WalletType.haven:

View file

@ -34,7 +34,7 @@ dependencies:
local_auth: ^2.1.0 local_auth: ^2.1.0
package_info: ^2.0.0 package_info: ^2.0.0
#package_info_plus: ^1.4.2 #package_info_plus: ^1.4.2
devicelocale: ^0.5.4 devicelocale: ^0.4.3
auto_size_text: ^3.0.0 auto_size_text: ^3.0.0
dotted_border: ^2.0.0+2 dotted_border: ^2.0.0+2
smooth_page_indicator: ^1.0.0+2 smooth_page_indicator: ^1.0.0+2

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "GETRENNT", "sync_status_failed_connect" : "GETRENNT",
"sync_status_connecting" : "VERBINDEN", "sync_status_connecting" : "VERBINDEN",
"sync_status_connected" : "VERBUNDEN", "sync_status_connected" : "VERBUNDEN",
"sync_status_attempting_sync" : "SYNC VERSUCHEN",
"transaction_priority_slow" : "Langsam", "transaction_priority_slow" : "Langsam",
@ -651,5 +652,13 @@
"ignor": "Ignorieren", "ignor": "Ignorieren",
"use_suggested": "Vorgeschlagen verwenden", "use_suggested": "Vorgeschlagen verwenden",
"do_not_share_warning_text" : "Teilen Sie diese nicht mit anderen, einschließlich des Supports.\n\nSie werden Ihr Geld stehlen!", "do_not_share_warning_text" : "Teilen Sie diese nicht mit anderen, einschließlich des Supports.\n\nSie werden Ihr Geld stehlen!",
"help": "hilfe" "help": "hilfe",
"connection_sync": "Verbindung und Synchronisierung",
"security_and_backup": "Sicherheit und Datensicherung",
"create_backup": "Backup erstellen",
"privacy_settings": "Datenschutzeinstellungen",
"privacy": "Datenschutz",
"display_settings": "Anzeigeeinstellungen",
"other_settings": "Andere Einstellungen",
"disable_exchange": "Exchange deaktivieren"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "DISCONNECTED", "sync_status_failed_connect" : "DISCONNECTED",
"sync_status_connecting" : "CONNECTING", "sync_status_connecting" : "CONNECTING",
"sync_status_connected" : "CONNECTED", "sync_status_connected" : "CONNECTED",
"sync_status_attempting_sync" : "ATTEMPTING SYNC",
"transaction_priority_slow" : "Slow", "transaction_priority_slow" : "Slow",
@ -651,5 +652,13 @@
"ignor": "Ignore", "ignor": "Ignore",
"use_suggested": "Use Suggested", "use_suggested": "Use Suggested",
"do_not_share_warning_text" : "Do not share these with anyone else, including support.\n\nThey will steal your money!", "do_not_share_warning_text" : "Do not share these with anyone else, including support.\n\nThey will steal your money!",
"help": "help" "help": "help",
"connection_sync": "Connection and sync",
"security_and_backup": "Security and backup",
"create_backup": "Create backup",
"privacy_settings": "Privacy settings",
"privacy": "Privacy",
"display_settings": "Display settings",
"other_settings": "Other settings",
"disable_exchange": "Disable exchange"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "DESCONECTADO", "sync_status_failed_connect" : "DESCONECTADO",
"sync_status_connecting" : "CONECTANDO", "sync_status_connecting" : "CONECTANDO",
"sync_status_connected" : "CONECTADO", "sync_status_connected" : "CONECTADO",
"sync_status_attempting_sync" : "INTENTAR SINCRONIZAR",
"transaction_priority_slow" : "Lento", "transaction_priority_slow" : "Lento",
@ -651,5 +652,13 @@
"ignor": "Pasar por alto", "ignor": "Pasar por alto",
"use_suggested": "Usar sugerido", "use_suggested": "Usar sugerido",
"do_not_share_warning_text" : "No comparta estos con nadie más, incluido el soporte.\n\n¡Te robarán tu dinero!", "do_not_share_warning_text" : "No comparta estos con nadie más, incluido el soporte.\n\n¡Te robarán tu dinero!",
"help": "ayuda" "help": "ayuda",
"connection_sync": "Conexión y sincronización",
"security_and_backup": "Seguridad y respaldo",
"create_backup": "Crear copia de seguridad",
"privacy_settings": "Configuración de privacidad",
"privacy": "Privacidad",
"display_settings": "Configuración de pantalla",
"other_settings": "Otras configuraciones",
"disable_exchange": "Deshabilitar intercambio"
} }

View file

@ -354,6 +354,7 @@
"sync_status_failed_connect" : "DÉCONNECTÉ", "sync_status_failed_connect" : "DÉCONNECTÉ",
"sync_status_connecting" : "CONNEXION EN COURS", "sync_status_connecting" : "CONNEXION EN COURS",
"sync_status_connected" : "CONNECTÉ", "sync_status_connected" : "CONNECTÉ",
"sync_status_attempting_sync" : "TENTATIVE DE SYNCHRONISATION",
"transaction_priority_slow" : "Lent", "transaction_priority_slow" : "Lent",
@ -649,5 +650,13 @@
"ignor": "Ignorer", "ignor": "Ignorer",
"use_suggested": "Utilisation suggérée", "use_suggested": "Utilisation suggérée",
"do_not_share_warning_text" : "Ne les partagez avec personne d'autre, y compris avec l'assistance.\n\nIls vont voler votre argent!", "do_not_share_warning_text" : "Ne les partagez avec personne d'autre, y compris avec l'assistance.\n\nIls vont voler votre argent!",
"help": "aider" "help": "aider",
"connection_sync": "Connexion et synchronisation",
"security_and_backup": "Sécurité et sauvegarde",
"create_backup": "Créer une sauvegarde",
"privacy_settings": "Paramètres de confidentialité",
"privacy": "Confidentialité",
"display_settings": "Paramètres d'affichage",
"other_settings": "Autres paramètres",
"disable_exchange": "Désactiver l'échange"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "डिस्कनेक्ट किया गया", "sync_status_failed_connect" : "डिस्कनेक्ट किया गया",
"sync_status_connecting" : "कनेक्ट", "sync_status_connecting" : "कनेक्ट",
"sync_status_connected" : "जुड़े हुए", "sync_status_connected" : "जुड़े हुए",
"sync_status_attempting_sync" : "सिंक करने का प्रयास",
"transaction_priority_slow" : "धीरे", "transaction_priority_slow" : "धीरे",
@ -651,5 +652,13 @@
"ignor": "नज़रअंदाज़ करना", "ignor": "नज़रअंदाज़ करना",
"use_suggested": "सुझाए गए का प्रयोग करें", "use_suggested": "सुझाए गए का प्रयोग करें",
"do_not_share_warning_text" : "इन्हें समर्थन सहित किसी और के साथ साझा न करें।\n\nवे आपका पैसा चुरा लेंगे!", "do_not_share_warning_text" : "इन्हें समर्थन सहित किसी और के साथ साझा न करें।\n\nवे आपका पैसा चुरा लेंगे!",
"help": "मदद करना" "help": "मदद करना",
"connection_sync": "कनेक्शन और सिंक",
"security_and_backup": "सुरक्षा और बैकअप",
"create_backup": "बैकअप बनाएँ",
"privacy_settings": "गोपनीयता सेटिंग्स",
"privacy": "गोपनीयता",
"display_settings": "प्रदर्शन सेटिंग्स",
"other_settings": "अन्य सेटिंग्स",
"disable_exchange": "एक्सचेंज अक्षम करें"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "ISKLJUČENO", "sync_status_failed_connect" : "ISKLJUČENO",
"sync_status_connecting" : "SPAJANJE", "sync_status_connecting" : "SPAJANJE",
"sync_status_connected" : "SPOJENO", "sync_status_connected" : "SPOJENO",
"sync_status_attempting_sync" : "POKUŠAJ SINKRONIZACIJE",
"transaction_priority_slow" : "Sporo", "transaction_priority_slow" : "Sporo",
@ -651,5 +652,13 @@
"ignor": "Zanemariti", "ignor": "Zanemariti",
"use_suggested": "Koristite predloženo", "use_suggested": "Koristite predloženo",
"do_not_share_warning_text" : "Nemojte ih dijeliti ni s kim, uključujući podršku.\n\nUkrast će vam novac!", "do_not_share_warning_text" : "Nemojte ih dijeliti ni s kim, uključujući podršku.\n\nUkrast će vam novac!",
"help": "pomozite" "help": "pomozite",
"connection_sync": "Povezivanje i sinkronizacija",
"security_and_backup": "Sigurnost i sigurnosna kopija",
"create_backup": "Stvori sigurnosnu kopiju",
"privacy_settings": "Postavke privatnosti",
"privacy": "Privatnost",
"display_settings": "Postavke zaslona",
"other_settings": "Ostale postavke",
"disable_exchange": "Onemogući exchange"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "DISCONNESSO", "sync_status_failed_connect" : "DISCONNESSO",
"sync_status_connecting" : "CONNESSIONE", "sync_status_connecting" : "CONNESSIONE",
"sync_status_connected" : "CONNESSO", "sync_status_connected" : "CONNESSO",
"sync_status_attempting_sync" : "TENTATIVO DI SINCRONIZZAZIONE",
"transaction_priority_slow" : "Bassa", "transaction_priority_slow" : "Bassa",
@ -651,5 +652,13 @@
"ignor": "Ignorare", "ignor": "Ignorare",
"use_suggested": "Usa suggerito", "use_suggested": "Usa suggerito",
"do_not_share_warning_text" : "Non condividerli con nessun altro, incluso il supporto.\n\nTi ruberanno i soldi!", "do_not_share_warning_text" : "Non condividerli con nessun altro, incluso il supporto.\n\nTi ruberanno i soldi!",
"help": "aiuto" "help": "aiuto",
"connection_sync": "Connessione e sincronizzazione",
"security_and_backup": "Sicurezza e backup",
"create_backup": "Crea backup",
"privacy_settings": "Impostazioni privacy",
"privacy": "Privacy",
"display_settings": "Impostazioni di visualizzazione",
"other_settings": "Altre impostazioni",
"disable_exchange": "Disabilita scambio"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "切断されました", "sync_status_failed_connect" : "切断されました",
"sync_status_connecting" : "接続中", "sync_status_connecting" : "接続中",
"sync_status_connected" : "接続済み", "sync_status_connected" : "接続済み",
"sync_status_attempting_sync" : "同期を試みています",
"transaction_priority_slow" : "スロー", "transaction_priority_slow" : "スロー",
@ -651,5 +652,13 @@
"ignor": "無視", "ignor": "無視",
"use_suggested": "推奨を使用", "use_suggested": "推奨を使用",
"do_not_share_warning_text" : "サポートを含め、これらを他の誰とも共有しないでください。\n\n彼らはあなたのお金を盗みます", "do_not_share_warning_text" : "サポートを含め、これらを他の誰とも共有しないでください。\n\n彼らはあなたのお金を盗みます",
"help": "ヘルプ" "help": "ヘルプ",
"connection_sync": "接続と同期",
"security_and_backup": "セキュリティとバックアップ",
"create_backup": "バックアップを作成",
"privacy_settings": "プライバシー設定",
"privacy": "プライバシー",
"display_settings": "表示設定",
"other_settings": "その他の設定",
"disable_exchange": "交換を無効にする"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "연결 해제", "sync_status_failed_connect" : "연결 해제",
"sync_status_connecting" : "연결 중", "sync_status_connecting" : "연결 중",
"sync_status_connected" : "연결됨", "sync_status_connected" : "연결됨",
"sync_status_attempting_sync" : "동기화 시도 중",
"transaction_priority_slow" : "느린", "transaction_priority_slow" : "느린",
@ -651,5 +652,13 @@
"ignor": "무시하다", "ignor": "무시하다",
"use_suggested": "추천 사용", "use_suggested": "추천 사용",
"do_not_share_warning_text" : "지원을 포함하여 다른 사람과 이러한 정보를 공유하지 마십시오.\n\n그들은 당신의 돈을 훔칠 것입니다!", "do_not_share_warning_text" : "지원을 포함하여 다른 사람과 이러한 정보를 공유하지 마십시오.\n\n그들은 당신의 돈을 훔칠 것입니다!",
"help": "돕다" "help": "돕다",
"connection_sync": "연결 및 동기화",
"security_and_backup": "보안 및 백업",
"create_backup": "백업 생성",
"privacy_settings": "개인정보 설정",
"privacy": "프라이버시",
"display_settings": "디스플레이 설정",
"other_settings": "기타 설정",
"disable_exchange": "교환 비활성화"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "LOSGEKOPPELD", "sync_status_failed_connect" : "LOSGEKOPPELD",
"sync_status_connecting" : "AANSLUITING", "sync_status_connecting" : "AANSLUITING",
"sync_status_connected" : "VERBONDEN", "sync_status_connected" : "VERBONDEN",
"sync_status_attempting_sync" : "SYNCHRONISATIE PROBEREN",
"transaction_priority_slow" : "Langzaam", "transaction_priority_slow" : "Langzaam",
@ -651,5 +652,13 @@
"ignor": "Negeren", "ignor": "Negeren",
"use_suggested": "Gebruik aanbevolen", "use_suggested": "Gebruik aanbevolen",
"do_not_share_warning_text" : "Deel deze met niemand anders, ook niet met support.\n\nZe zullen je geld stelen!", "do_not_share_warning_text" : "Deel deze met niemand anders, ook niet met support.\n\nZe zullen je geld stelen!",
"help": "helpen" "help": "helpen",
"connection_sync": "Verbinding en synchronisatie",
"security_and_backup": "Beveiliging en back-up",
"create_backup": "Maak een back-up",
"privacy_settings": "Privacy-instellingen",
"privacy": "Privacy",
"display_settings": "Weergave-instellingen",
"other_settings": "Andere instellingen",
"disable_exchange": "Uitwisseling uitschakelen"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "NIEPOWIĄZANY", "sync_status_failed_connect" : "NIEPOWIĄZANY",
"sync_status_connecting" : "ZŁĄCZONY", "sync_status_connecting" : "ZŁĄCZONY",
"sync_status_connected" : "POŁĄCZONY", "sync_status_connected" : "POŁĄCZONY",
"sync_status_attempting_sync" : "PRÓBA SYNCHRONIZACJI",
"transaction_priority_slow" : "Powolny", "transaction_priority_slow" : "Powolny",
@ -651,5 +652,13 @@
"ignor": "Ignorować", "ignor": "Ignorować",
"use_suggested": "Użyj sugerowane", "use_suggested": "Użyj sugerowane",
"do_not_share_warning_text" : "Nie udostępniaj ich nikomu innemu, w tym wsparcia.\n\nUkradną twoje pieniądze!", "do_not_share_warning_text" : "Nie udostępniaj ich nikomu innemu, w tym wsparcia.\n\nUkradną twoje pieniądze!",
"help": "pomoc" "help": "pomoc",
"connection_sync": "Połączenie i synchronizacja",
"security_and_backup": "Bezpieczeństwo i kopia zapasowa",
"create_backup": "Utwórz kopię zapasową",
"privacy_settings": "Ustawienia prywatności",
"privacy": "Prywatność",
"display_settings": "Ustawienia wyświetlania",
"other_settings": "Inne ustawienia",
"disable_exchange": "Wyłącz wymianę"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "DESCONECTADO", "sync_status_failed_connect" : "DESCONECTADO",
"sync_status_connecting" : "CONECTANDO", "sync_status_connecting" : "CONECTANDO",
"sync_status_connected" : "CONECTADO", "sync_status_connected" : "CONECTADO",
"sync_status_attempting_sync" : "TENTANDO SINCRONIZAR",
"transaction_priority_slow" : "Lenta", "transaction_priority_slow" : "Lenta",
@ -651,5 +652,13 @@
"ignor": "Ignorar", "ignor": "Ignorar",
"use_suggested": "Uso sugerido", "use_suggested": "Uso sugerido",
"do_not_share_warning_text" : "Não os compartilhe com mais ninguém, incluindo suporte.\n\nEles vão roubar seu dinheiro!", "do_not_share_warning_text" : "Não os compartilhe com mais ninguém, incluindo suporte.\n\nEles vão roubar seu dinheiro!",
"help": "ajuda" "help": "ajuda",
"connection_sync": "Conexão e sincronização",
"security_and_backup": "Segurança e backup",
"create_backup": "Criar backup",
"privacy_settings": "Configurações de privacidade",
"privacy": "Privacidade",
"display_settings": "Configurações de exibição",
"other_settings": "Outras configurações",
"disable_exchange": "Desativar troca"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "ОТКЛЮЧЕНО", "sync_status_failed_connect" : "ОТКЛЮЧЕНО",
"sync_status_connecting" : "ПОДКЛЮЧЕНИЕ", "sync_status_connecting" : "ПОДКЛЮЧЕНИЕ",
"sync_status_connected" : "ПОДКЛЮЧЕНО", "sync_status_connected" : "ПОДКЛЮЧЕНО",
"sync_status_attempting_sync" : "ПОПЫТКА СИНХРОНИЗАЦИИ",
"transaction_priority_slow" : "Медленный", "transaction_priority_slow" : "Медленный",
@ -651,5 +652,13 @@
"ignor": "Игнорировать", "ignor": "Игнорировать",
"use_suggested": "Использовать предложенный", "use_suggested": "Использовать предложенный",
"do_not_share_warning_text" : "Не делитесь ими с кем-либо еще, в том числе со службой поддержки.\n\nОни украдут ваши деньги!", "do_not_share_warning_text" : "Не делитесь ими с кем-либо еще, в том числе со службой поддержки.\n\nОни украдут ваши деньги!",
"help": "помощь" "help": "помощь",
"connection_sync": "Подключение и синхронизация",
"security_and_backup": "Безопасность и резервное копирование",
"create_backup": "Создать резервную копию",
"privacy_settings": "Настройки конфиденциальности",
"privacy": "Конфиденциальность",
"display_settings": "Настройки отображения",
"other_settings": "Другие настройки",
"disable_exchange": "Отключить обмен"
} }

View file

@ -355,6 +355,7 @@
"sync_status_failed_connect" : "ВІДКЛЮЧЕНО", "sync_status_failed_connect" : "ВІДКЛЮЧЕНО",
"sync_status_connecting" : "ПІДКЛЮЧЕННЯ", "sync_status_connecting" : "ПІДКЛЮЧЕННЯ",
"sync_status_connected" : "ПІДКЛЮЧЕНО", "sync_status_connected" : "ПІДКЛЮЧЕНО",
"sync_status_attempting_sync" : "СПРОБА СИНХРОНІЗАЦІЇ",
"transaction_priority_slow" : "Повільний", "transaction_priority_slow" : "Повільний",
@ -650,5 +651,13 @@
"ignor": "Ігнорувати", "ignor": "Ігнорувати",
"use_suggested": "Використати запропоноване", "use_suggested": "Використати запропоноване",
"do_not_share_warning_text" : "Не повідомляйте їх нікому, включно зі службою підтримки.\n\nВони вкрадуть ваші гроші!", "do_not_share_warning_text" : "Не повідомляйте їх нікому, включно зі службою підтримки.\n\nВони вкрадуть ваші гроші!",
"help": "допомога" "help": "допомога",
"connection_sync": "Підключення та синхронізація",
"security_and_backup": "Безпека та резервне копіювання",
"create_backup": "Створити резервну копію",
"privacy_settings": "Налаштування конфіденційності",
"privacy": "Конфіденційність",
"display_settings": "Налаштування дисплея",
"other_settings": "Інші налаштування",
"disable_exchange": "Вимкнути exchange"
} }

View file

@ -356,6 +356,7 @@
"sync_status_failed_connect" : "断线", "sync_status_failed_connect" : "断线",
"sync_status_connecting" : "连接中", "sync_status_connecting" : "连接中",
"sync_status_connected" : "已连接", "sync_status_connected" : "已连接",
"sync_status_attempting_sync" : "嘗試同步",
"transaction_priority_slow" : "慢速", "transaction_priority_slow" : "慢速",
@ -649,5 +650,13 @@
"ignor": "忽视", "ignor": "忽视",
"use_suggested": "使用建议", "use_suggested": "使用建议",
"do_not_share_warning_text" : "不要與其他任何人分享這些內容,包括支持。\n\n他們會偷你的錢", "do_not_share_warning_text" : "不要與其他任何人分享這些內容,包括支持。\n\n他們會偷你的錢",
"help": "帮助" "help": "帮助",
"connection_sync": "连接和同步",
"security_and_backup": "安全和备份",
"create_backup": "创建备份",
"privacy_settings": "隐私设置",
"privacy":"隐私",
"display_settings": "显示设置",
"other_settings": "其他设置",
"disable_exchange": "禁用交换"
} }

View file

@ -28,6 +28,7 @@ class SecretKey {
SecretKey('simpleSwapApiKey', () => ''), SecretKey('simpleSwapApiKey', () => ''),
SecretKey('anypayToken', () => ''), SecretKey('anypayToken', () => ''),
SecretKey('onramperApiKey', () => ''), SecretKey('onramperApiKey', () => ''),
SecretKey('ioniaClientId', () => ''),
]; ];
final String name; final String name;