2023-05-26 21:21:16 +00:00
|
|
|
/*
|
|
|
|
* This file is part of Stack Wallet.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2023 Cypher Stack
|
|
|
|
* All Rights Reserved.
|
|
|
|
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
|
|
|
* Generated by Cypher Stack on 2023-05-26
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-08-26 08:11:35 +00:00
|
|
|
import 'package:flutter/cupertino.dart';
|
2023-03-01 21:52:13 +00:00
|
|
|
import 'package:stackwallet/db/hive/db.dart';
|
2023-09-07 15:20:45 +00:00
|
|
|
import 'package:stackwallet/services/event_bus/events/global/tor_status_changed_event.dart';
|
|
|
|
import 'package:stackwallet/services/event_bus/global_event_bus.dart';
|
2023-05-29 17:42:11 +00:00
|
|
|
import 'package:stackwallet/utilities/amount/amount_unit.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
import 'package:stackwallet/utilities/constants.dart';
|
|
|
|
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
|
2023-05-29 17:42:11 +00:00
|
|
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
import 'package:stackwallet/utilities/enums/languages_enum.dart';
|
|
|
|
import 'package:stackwallet/utilities/enums/sync_type_enum.dart';
|
2023-01-24 21:28:56 +00:00
|
|
|
import 'package:uuid/uuid.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
class Prefs extends ChangeNotifier {
|
|
|
|
Prefs._();
|
|
|
|
static final Prefs _instance = Prefs._();
|
|
|
|
static Prefs get instance => _instance;
|
|
|
|
|
|
|
|
bool _initialized = false;
|
|
|
|
bool get isInitialized => _initialized;
|
|
|
|
|
|
|
|
Future<void> init() async {
|
|
|
|
if (!_initialized) {
|
|
|
|
_currency = await _getPreferredCurrency();
|
2023-02-08 20:48:09 +00:00
|
|
|
// _exchangeRateType = await _getExchangeRateType();
|
2023-05-01 22:41:13 +00:00
|
|
|
_randomizePIN = await _getRandomizePIN();
|
2022-08-26 08:11:35 +00:00
|
|
|
_useBiometrics = await _getUseBiometrics();
|
|
|
|
_hasPin = await _getHasPin();
|
|
|
|
_language = await _getPreferredLanguage();
|
|
|
|
_showFavoriteWallets = await _getShowFavoriteWallets();
|
|
|
|
_wifiOnly = await _getUseWifiOnly();
|
|
|
|
_syncType = await _getSyncType();
|
|
|
|
_walletIdsSyncOnStartup = await _getWalletIdsSyncOnStartup();
|
|
|
|
_currentNotificationId = await _getCurrentNotificationIndex();
|
|
|
|
_lastUnlocked = await _getLastUnlocked();
|
|
|
|
_lastUnlockedTimeout = await _getLastUnlockedTimeout();
|
|
|
|
_showTestNetCoins = await _getShowTestNetCoins();
|
2023-09-01 22:50:17 +00:00
|
|
|
_torKillswitch = await _getTorKillswitch();
|
2022-08-26 08:11:35 +00:00
|
|
|
_isAutoBackupEnabled = await _getIsAutoBackupEnabled();
|
|
|
|
_autoBackupLocation = await _getAutoBackupLocation();
|
|
|
|
_backupFrequencyType = await _getBackupFrequencyType();
|
|
|
|
_lastAutoBackup = await _getLastAutoBackup();
|
2022-09-07 23:28:33 +00:00
|
|
|
_hideBlockExplorerWarning = await _getHideBlockExplorerWarning();
|
2022-09-09 16:51:34 +00:00
|
|
|
_gotoWalletOnStartup = await _getGotoWalletOnStartup();
|
|
|
|
_startupWalletId = await _getStartupWalletId();
|
2022-10-11 14:15:51 +00:00
|
|
|
_externalCalls = await _getHasExternalCalls();
|
2022-11-25 23:14:06 +00:00
|
|
|
_familiarity = await _getHasFamiliarity();
|
2023-01-25 16:33:32 +00:00
|
|
|
_userId = await _getUserId();
|
2023-01-25 17:08:05 +00:00
|
|
|
_signupEpoch = await _getSignupEpoch();
|
2023-03-08 21:12:04 +00:00
|
|
|
_enableCoinControl = await _getEnableCoinControl();
|
2023-03-20 22:02:20 +00:00
|
|
|
_enableSystemBrightness = await _getEnableSystemBrightness();
|
2023-05-09 20:20:29 +00:00
|
|
|
_themeId = await _getThemeId();
|
|
|
|
_systemBrightnessLightThemeId = await _getSystemBrightnessLightThemeId();
|
|
|
|
_systemBrightnessDarkThemeId = await _getSystemBrightnessDarkTheme();
|
2023-05-29 17:42:11 +00:00
|
|
|
await _setAmountUnits();
|
|
|
|
await _setMaxDecimals();
|
2023-08-07 17:06:44 +00:00
|
|
|
_useTor = await _getUseTor();
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
_initialized = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// last timestamp user unlocked wallet
|
|
|
|
|
|
|
|
int _lastUnlockedTimeout = 60;
|
|
|
|
|
|
|
|
int get lastUnlockedTimeout => _lastUnlockedTimeout;
|
|
|
|
|
|
|
|
set lastUnlockedTimeout(int lastUnlockedTimeout) {
|
|
|
|
if (_lastUnlockedTimeout != lastUnlockedTimeout) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "lastUnlockedTimeout",
|
|
|
|
value: lastUnlockedTimeout);
|
|
|
|
_lastUnlockedTimeout = lastUnlockedTimeout;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<int> _getLastUnlockedTimeout() async {
|
|
|
|
return (DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "lastUnlockedTimeout")) as int? ??
|
|
|
|
60;
|
|
|
|
}
|
|
|
|
|
|
|
|
// last timestamp user unlocked wallet
|
|
|
|
|
|
|
|
int _lastUnlocked = 0;
|
|
|
|
|
|
|
|
int get lastUnlocked => _lastUnlocked;
|
|
|
|
|
|
|
|
set lastUnlocked(int lastUnlocked) {
|
|
|
|
if (_lastUnlocked != lastUnlocked) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "lastUnlocked", value: lastUnlocked);
|
|
|
|
_lastUnlocked = lastUnlocked;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<int> _getLastUnlocked() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "lastUnlocked") as int? ??
|
|
|
|
0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// notification index
|
|
|
|
|
|
|
|
late int _currentNotificationId;
|
|
|
|
|
|
|
|
int get currentNotificationId => _currentNotificationId;
|
|
|
|
|
|
|
|
Future<void> incrementCurrentNotificationIndex() async {
|
|
|
|
if (_currentNotificationId <= Constants.notificationsMax) {
|
|
|
|
_currentNotificationId++;
|
|
|
|
} else {
|
|
|
|
_currentNotificationId = 0;
|
|
|
|
}
|
|
|
|
await DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "currentNotificationId",
|
|
|
|
value: _currentNotificationId);
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<int> _getCurrentNotificationIndex() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "currentNotificationId") as int? ??
|
|
|
|
0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// list of wallet ids to auto sync when auto sync only selected wallets is chosen
|
|
|
|
|
|
|
|
List<String> _walletIdsSyncOnStartup = [];
|
|
|
|
|
|
|
|
List<String> get walletIdsSyncOnStartup => _walletIdsSyncOnStartup;
|
|
|
|
|
|
|
|
set walletIdsSyncOnStartup(List<String> walletIdsSyncOnStartup) {
|
|
|
|
if (_walletIdsSyncOnStartup != walletIdsSyncOnStartup) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "walletIdsSyncOnStartup",
|
|
|
|
value: walletIdsSyncOnStartup);
|
|
|
|
_walletIdsSyncOnStartup = walletIdsSyncOnStartup;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<String>> _getWalletIdsSyncOnStartup() async {
|
|
|
|
final list = await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "walletIdsSyncOnStartup") as List? ??
|
|
|
|
[];
|
|
|
|
return List<String>.from(list);
|
|
|
|
}
|
|
|
|
|
|
|
|
// sync type
|
|
|
|
|
|
|
|
SyncingType _syncType = SyncingType.allWalletsOnStartup;
|
|
|
|
|
|
|
|
SyncingType get syncType => _syncType;
|
|
|
|
|
|
|
|
set syncType(SyncingType syncType) {
|
|
|
|
if (_syncType != syncType) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "syncTypeIndex",
|
|
|
|
value: syncType.index);
|
|
|
|
_syncType = syncType;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<SyncingType> _getSyncType() async {
|
|
|
|
final int index = await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "syncTypeIndex") as int? ??
|
|
|
|
SyncingType.allWalletsOnStartup.index;
|
|
|
|
return SyncingType.values[index];
|
|
|
|
}
|
|
|
|
|
|
|
|
// wifi only
|
|
|
|
|
|
|
|
bool _wifiOnly = false;
|
|
|
|
|
|
|
|
bool get wifiOnly => _wifiOnly;
|
|
|
|
|
|
|
|
set wifiOnly(bool wifiOnly) {
|
|
|
|
if (_wifiOnly != wifiOnly) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "wifiOnly", value: wifiOnly);
|
|
|
|
_wifiOnly = wifiOnly;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getUseWifiOnly() async {
|
|
|
|
return await DB.instance
|
|
|
|
.get<dynamic>(boxName: DB.boxNamePrefs, key: "wifiOnly") as bool? ??
|
|
|
|
false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// show favorites
|
|
|
|
|
|
|
|
bool _showFavoriteWallets = true;
|
|
|
|
|
|
|
|
bool get showFavoriteWallets => _showFavoriteWallets;
|
|
|
|
|
|
|
|
set showFavoriteWallets(bool showFavoriteWallets) {
|
|
|
|
if (_showFavoriteWallets != showFavoriteWallets) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "showFavoriteWallets",
|
|
|
|
value: showFavoriteWallets);
|
|
|
|
_showFavoriteWallets = showFavoriteWallets;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getShowFavoriteWallets() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "showFavoriteWallets") as bool? ??
|
|
|
|
true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// language
|
|
|
|
|
|
|
|
String _language = Language.englishUS.description;
|
|
|
|
|
|
|
|
String get language => _language;
|
|
|
|
|
|
|
|
set language(String newLanguage) {
|
|
|
|
if (_language != newLanguage) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "language", value: newLanguage);
|
|
|
|
_language = newLanguage;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<String> _getPreferredLanguage() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "language") as String? ??
|
|
|
|
Language.englishUS.description;
|
|
|
|
}
|
|
|
|
|
|
|
|
// base currency
|
|
|
|
|
|
|
|
String _currency = "USD";
|
|
|
|
|
|
|
|
String get currency => _currency;
|
|
|
|
|
|
|
|
set currency(String newCurrency) {
|
|
|
|
if (currency != newCurrency) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "currency", value: newCurrency);
|
|
|
|
_currency = newCurrency;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<String> _getPreferredCurrency() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "currency") as String? ??
|
|
|
|
"USD";
|
|
|
|
}
|
|
|
|
|
|
|
|
// exchange rate type
|
|
|
|
|
2023-02-08 20:48:09 +00:00
|
|
|
// ExchangeRateType _exchangeRateType = ExchangeRateType.estimated;
|
|
|
|
//
|
|
|
|
// ExchangeRateType get exchangeRateType => _exchangeRateType;
|
|
|
|
//
|
|
|
|
// set exchangeRateType(ExchangeRateType exchangeRateType) {
|
|
|
|
// if (_exchangeRateType != exchangeRateType) {
|
|
|
|
// switch (exchangeRateType) {
|
|
|
|
// case ExchangeRateType.estimated:
|
|
|
|
// DB.instance.put<dynamic>(
|
|
|
|
// boxName: DB.boxNamePrefs,
|
|
|
|
// key: "exchangeRateType",
|
|
|
|
// value: "estimated");
|
|
|
|
// break;
|
|
|
|
// case ExchangeRateType.fixed:
|
|
|
|
// DB.instance.put<dynamic>(
|
|
|
|
// boxName: DB.boxNamePrefs,
|
|
|
|
// key: "exchangeRateType",
|
|
|
|
// value: "fixed");
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// _exchangeRateType = exchangeRateType;
|
|
|
|
// notifyListeners();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// Future<ExchangeRateType> _getExchangeRateType() async {
|
|
|
|
// String? rate = await DB.instance.get<dynamic>(
|
|
|
|
// boxName: DB.boxNamePrefs, key: "exchangeRateType") as String?;
|
|
|
|
// rate ??= "estimated";
|
|
|
|
// switch (rate) {
|
|
|
|
// case "estimated":
|
|
|
|
// return ExchangeRateType.estimated;
|
|
|
|
// case "fixed":
|
|
|
|
// return ExchangeRateType.fixed;
|
|
|
|
// default:
|
|
|
|
// throw Exception("Invalid exchange rate type found in prefs!");
|
|
|
|
// }
|
|
|
|
// }
|
2022-08-26 08:11:35 +00:00
|
|
|
|
2023-04-28 18:03:54 +00:00
|
|
|
// randomize PIN
|
|
|
|
|
|
|
|
bool _randomizePIN = false;
|
|
|
|
|
|
|
|
bool get randomizePIN => _randomizePIN;
|
|
|
|
|
|
|
|
set randomizePIN(bool randomizePIN) {
|
|
|
|
if (_randomizePIN != randomizePIN) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "randomizePIN", value: randomizePIN);
|
|
|
|
_randomizePIN = randomizePIN;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getRandomizePIN() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "randomizePIN") as bool? ??
|
|
|
|
false;
|
|
|
|
}
|
|
|
|
|
2022-08-26 08:11:35 +00:00
|
|
|
// use biometrics
|
|
|
|
|
|
|
|
bool _useBiometrics = false;
|
|
|
|
|
|
|
|
bool get useBiometrics => _useBiometrics;
|
|
|
|
|
|
|
|
set useBiometrics(bool useBiometrics) {
|
|
|
|
if (_useBiometrics != useBiometrics) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "useBiometrics", value: useBiometrics);
|
|
|
|
_useBiometrics = useBiometrics;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getUseBiometrics() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "useBiometrics") as bool? ??
|
|
|
|
false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// has set up pin
|
|
|
|
|
|
|
|
bool _hasPin = false;
|
|
|
|
|
|
|
|
bool get hasPin => _hasPin;
|
|
|
|
|
|
|
|
set hasPin(bool hasPin) {
|
|
|
|
if (_hasPin != hasPin) {
|
|
|
|
DB.instance
|
|
|
|
.put<dynamic>(boxName: DB.boxNamePrefs, key: "hasPin", value: hasPin);
|
|
|
|
_hasPin = hasPin;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getHasPin() async {
|
|
|
|
return await DB.instance
|
|
|
|
.get<dynamic>(boxName: DB.boxNamePrefs, key: "hasPin") as bool? ??
|
|
|
|
false;
|
|
|
|
}
|
|
|
|
|
2022-11-25 23:14:06 +00:00
|
|
|
// familiarity
|
|
|
|
|
|
|
|
int _familiarity = 0;
|
|
|
|
|
|
|
|
int get familiarity => _familiarity;
|
|
|
|
|
|
|
|
set familiarity(int familiarity) {
|
|
|
|
if (_familiarity != familiarity) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "familiarity", value: familiarity);
|
|
|
|
_familiarity = familiarity;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<int> _getHasFamiliarity() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "familiarity") as int? ??
|
|
|
|
0;
|
|
|
|
}
|
|
|
|
|
2023-09-01 22:50:17 +00:00
|
|
|
// tor
|
|
|
|
|
2023-09-13 16:33:44 +00:00
|
|
|
bool _torKillswitch = true;
|
2023-09-01 22:50:17 +00:00
|
|
|
|
2023-09-13 16:33:44 +00:00
|
|
|
bool get torKillSwitch => _torKillswitch;
|
2023-09-01 22:50:17 +00:00
|
|
|
|
2023-09-13 16:33:44 +00:00
|
|
|
set torKillSwitch(bool torKillswitch) {
|
|
|
|
if (_torKillswitch != torKillswitch) {
|
2023-09-01 22:50:17 +00:00
|
|
|
DB.instance.put<dynamic>(
|
2023-09-13 16:33:44 +00:00
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "torKillswitch",
|
|
|
|
value: torKillswitch,
|
|
|
|
);
|
2023-09-01 22:50:17 +00:00
|
|
|
_torKillswitch = torKillswitch;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getTorKillswitch() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
2023-09-13 16:33:44 +00:00
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "torKillswitch",
|
|
|
|
) as bool? ??
|
|
|
|
true;
|
2023-09-01 22:50:17 +00:00
|
|
|
}
|
|
|
|
|
2022-08-26 08:11:35 +00:00
|
|
|
// show testnet coins
|
|
|
|
|
|
|
|
bool _showTestNetCoins = false;
|
|
|
|
|
|
|
|
bool get showTestNetCoins => _showTestNetCoins;
|
|
|
|
|
|
|
|
set showTestNetCoins(bool showTestNetCoins) {
|
|
|
|
if (_showTestNetCoins != showTestNetCoins) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "showTestNetCoins",
|
|
|
|
value: showTestNetCoins);
|
|
|
|
_showTestNetCoins = showTestNetCoins;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getShowTestNetCoins() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "showTestNetCoins") as bool? ??
|
|
|
|
false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// auto backup
|
|
|
|
|
|
|
|
bool _isAutoBackupEnabled = false;
|
|
|
|
|
|
|
|
bool get isAutoBackupEnabled => _isAutoBackupEnabled;
|
|
|
|
|
|
|
|
set isAutoBackupEnabled(bool isAutoBackupEnabled) {
|
|
|
|
if (_isAutoBackupEnabled != isAutoBackupEnabled) {
|
|
|
|
DB.instance
|
|
|
|
.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "isAutoBackupEnabled",
|
|
|
|
value: isAutoBackupEnabled)
|
|
|
|
.then((_) {
|
|
|
|
_isAutoBackupEnabled = isAutoBackupEnabled;
|
|
|
|
notifyListeners();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getIsAutoBackupEnabled() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "isAutoBackupEnabled") as bool? ??
|
|
|
|
false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// auto backup file location uri
|
|
|
|
|
|
|
|
String? _autoBackupLocation;
|
|
|
|
|
|
|
|
String? get autoBackupLocation => _autoBackupLocation;
|
|
|
|
|
|
|
|
set autoBackupLocation(String? autoBackupLocation) {
|
|
|
|
if (this.autoBackupLocation != autoBackupLocation) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "autoBackupLocation",
|
|
|
|
value: autoBackupLocation);
|
|
|
|
_autoBackupLocation = autoBackupLocation;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<String?> _getAutoBackupLocation() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "autoBackupLocation") as String?;
|
|
|
|
}
|
|
|
|
|
|
|
|
// auto backup frequency type
|
|
|
|
|
|
|
|
BackupFrequencyType _backupFrequencyType =
|
|
|
|
BackupFrequencyType.everyTenMinutes;
|
|
|
|
|
|
|
|
BackupFrequencyType get backupFrequencyType => _backupFrequencyType;
|
|
|
|
|
|
|
|
set backupFrequencyType(BackupFrequencyType backupFrequencyType) {
|
|
|
|
if (_backupFrequencyType != backupFrequencyType) {
|
|
|
|
switch (backupFrequencyType) {
|
|
|
|
case BackupFrequencyType.everyTenMinutes:
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "backupFrequencyType",
|
|
|
|
value: "10Min");
|
|
|
|
break;
|
|
|
|
case BackupFrequencyType.everyAppStart:
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "backupFrequencyType",
|
|
|
|
value: "onStart");
|
|
|
|
break;
|
|
|
|
case BackupFrequencyType.afterClosingAWallet:
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "backupFrequencyType",
|
|
|
|
value: "onWalletClose");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
_backupFrequencyType = backupFrequencyType;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<BackupFrequencyType> _getBackupFrequencyType() async {
|
|
|
|
String? rate = await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "backupFrequencyType") as String?;
|
|
|
|
rate ??= "10Min";
|
|
|
|
switch (rate) {
|
|
|
|
case "10Min":
|
|
|
|
return BackupFrequencyType.everyTenMinutes;
|
|
|
|
case "onStart":
|
|
|
|
return BackupFrequencyType.everyAppStart;
|
|
|
|
case "onWalletClose":
|
|
|
|
return BackupFrequencyType.afterClosingAWallet;
|
|
|
|
default:
|
|
|
|
throw Exception("Invalid Backup Frequency type found in prefs!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// auto backup last time stamp
|
|
|
|
|
|
|
|
DateTime? _lastAutoBackup;
|
|
|
|
|
|
|
|
DateTime? get lastAutoBackup => _lastAutoBackup;
|
|
|
|
|
|
|
|
set lastAutoBackup(DateTime? lastAutoBackup) {
|
|
|
|
if (this.lastAutoBackup != lastAutoBackup) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "lastAutoBackup",
|
|
|
|
value: lastAutoBackup);
|
|
|
|
_lastAutoBackup = lastAutoBackup;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<DateTime?> _getLastAutoBackup() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "autoBackupFileUri") as DateTime?;
|
|
|
|
}
|
2022-09-07 23:28:33 +00:00
|
|
|
|
|
|
|
// auto backup
|
|
|
|
|
|
|
|
bool _hideBlockExplorerWarning = false;
|
|
|
|
|
|
|
|
bool get hideBlockExplorerWarning => _hideBlockExplorerWarning;
|
|
|
|
|
|
|
|
set hideBlockExplorerWarning(bool hideBlockExplorerWarning) {
|
|
|
|
if (_hideBlockExplorerWarning != hideBlockExplorerWarning) {
|
|
|
|
DB.instance
|
|
|
|
.put<dynamic>(
|
2022-09-09 16:51:34 +00:00
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "hideBlockExplorerWarning",
|
|
|
|
value: hideBlockExplorerWarning)
|
2022-09-07 23:28:33 +00:00
|
|
|
.then((_) {
|
|
|
|
_hideBlockExplorerWarning = hideBlockExplorerWarning;
|
|
|
|
notifyListeners();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getHideBlockExplorerWarning() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
2022-09-09 16:51:34 +00:00
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "hideBlockExplorerWarning") as bool? ??
|
2022-09-07 23:28:33 +00:00
|
|
|
false;
|
|
|
|
}
|
2022-09-09 16:51:34 +00:00
|
|
|
|
|
|
|
// auto backup
|
|
|
|
|
|
|
|
bool _gotoWalletOnStartup = false;
|
|
|
|
|
|
|
|
bool get gotoWalletOnStartup => _gotoWalletOnStartup;
|
|
|
|
|
|
|
|
set gotoWalletOnStartup(bool gotoWalletOnStartup) {
|
|
|
|
if (_gotoWalletOnStartup != gotoWalletOnStartup) {
|
|
|
|
DB.instance
|
|
|
|
.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "gotoWalletOnStartup",
|
|
|
|
value: gotoWalletOnStartup)
|
|
|
|
.then((_) {
|
|
|
|
_gotoWalletOnStartup = gotoWalletOnStartup;
|
|
|
|
notifyListeners();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getGotoWalletOnStartup() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "gotoWalletOnStartup") as bool? ??
|
|
|
|
false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// startup wallet id
|
|
|
|
|
|
|
|
String? _startupWalletId;
|
|
|
|
|
|
|
|
String? get startupWalletId => _startupWalletId;
|
|
|
|
|
|
|
|
set startupWalletId(String? startupWalletId) {
|
|
|
|
if (this.startupWalletId != startupWalletId) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "startupWalletId",
|
|
|
|
value: startupWalletId);
|
|
|
|
_startupWalletId = startupWalletId;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<String?> _getStartupWalletId() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "startupWalletId") as String?;
|
|
|
|
}
|
2022-10-11 14:15:51 +00:00
|
|
|
|
2022-10-17 19:42:10 +00:00
|
|
|
// incognito mode off by default
|
|
|
|
// allow external network calls such as exchange data and price info
|
2022-10-17 02:23:48 +00:00
|
|
|
bool _externalCalls = true;
|
2022-10-11 14:15:51 +00:00
|
|
|
|
|
|
|
bool get externalCalls => _externalCalls;
|
|
|
|
|
|
|
|
set externalCalls(bool externalCalls) {
|
|
|
|
if (_externalCalls != externalCalls) {
|
|
|
|
DB.instance
|
|
|
|
.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "externalCalls",
|
|
|
|
value: externalCalls)
|
|
|
|
.then((_) {
|
|
|
|
_externalCalls = externalCalls;
|
|
|
|
notifyListeners();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getHasExternalCalls() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "externalCalls") as bool? ??
|
2022-10-17 22:37:47 +00:00
|
|
|
true;
|
2022-10-11 14:15:51 +00:00
|
|
|
}
|
2022-10-19 22:51:50 +00:00
|
|
|
|
|
|
|
Future<bool> isExternalCallsSet() async {
|
|
|
|
if (await DB.instance
|
|
|
|
.get<dynamic>(boxName: DB.boxNamePrefs, key: "externalCalls") ==
|
|
|
|
null) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2023-01-24 21:28:56 +00:00
|
|
|
|
2023-01-25 16:33:32 +00:00
|
|
|
String? _userId;
|
|
|
|
String? get userID => _userId;
|
2023-01-24 21:28:56 +00:00
|
|
|
|
2023-01-25 16:33:32 +00:00
|
|
|
Future<String?> _getUserId() async {
|
2023-01-24 21:28:56 +00:00
|
|
|
String? userID = await DB.instance
|
|
|
|
.get<dynamic>(boxName: DB.boxNamePrefs, key: "userID") as String?;
|
|
|
|
if (userID == null) {
|
|
|
|
userID = const Uuid().v4();
|
|
|
|
await saveUserID(userID);
|
|
|
|
}
|
|
|
|
return userID;
|
|
|
|
}
|
|
|
|
|
2023-01-25 16:33:32 +00:00
|
|
|
Future<void> saveUserID(String userId) async {
|
|
|
|
_userId = userId;
|
2023-01-24 21:28:56 +00:00
|
|
|
await DB.instance
|
2023-01-25 16:33:32 +00:00
|
|
|
.put<dynamic>(boxName: DB.boxNamePrefs, key: "userID", value: _userId);
|
2023-01-24 21:28:56 +00:00
|
|
|
// notifyListeners();
|
|
|
|
}
|
2023-01-25 17:08:05 +00:00
|
|
|
|
|
|
|
int? _signupEpoch;
|
|
|
|
int? get signupEpoch => _signupEpoch;
|
|
|
|
|
|
|
|
Future<int?> _getSignupEpoch() async {
|
|
|
|
int? signupEpoch = await DB.instance
|
|
|
|
.get<dynamic>(boxName: DB.boxNamePrefs, key: "signupEpoch") as int?;
|
|
|
|
if (signupEpoch == null) {
|
|
|
|
signupEpoch = DateTime.now().millisecondsSinceEpoch ~/
|
|
|
|
Duration.millisecondsPerSecond;
|
|
|
|
await saveSignupEpoch(signupEpoch);
|
|
|
|
}
|
|
|
|
return signupEpoch;
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> saveSignupEpoch(int signupEpoch) async {
|
|
|
|
_signupEpoch = signupEpoch;
|
|
|
|
await DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "signupEpoch", value: _signupEpoch);
|
|
|
|
// notifyListeners();
|
|
|
|
}
|
2023-03-08 21:12:04 +00:00
|
|
|
|
|
|
|
// show testnet coins
|
|
|
|
|
|
|
|
bool _enableCoinControl = false;
|
|
|
|
|
|
|
|
bool get enableCoinControl => _enableCoinControl;
|
|
|
|
|
|
|
|
set enableCoinControl(bool enableCoinControl) {
|
|
|
|
if (_enableCoinControl != enableCoinControl) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "enableCoinControl",
|
|
|
|
value: enableCoinControl);
|
|
|
|
_enableCoinControl = enableCoinControl;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getEnableCoinControl() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "enableCoinControl") as bool? ??
|
|
|
|
false;
|
|
|
|
}
|
2023-03-20 22:02:20 +00:00
|
|
|
|
|
|
|
// follow system brightness
|
|
|
|
|
|
|
|
bool _enableSystemBrightness = false;
|
|
|
|
|
|
|
|
bool get enableSystemBrightness => _enableSystemBrightness;
|
|
|
|
|
|
|
|
set enableSystemBrightness(bool enableSystemBrightness) {
|
|
|
|
if (_enableSystemBrightness != enableSystemBrightness) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "enableSystemBrightness",
|
|
|
|
value: enableSystemBrightness);
|
|
|
|
_enableSystemBrightness = enableSystemBrightness;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getEnableSystemBrightness() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs, key: "enableSystemBrightness") as bool? ??
|
|
|
|
false;
|
|
|
|
}
|
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
// current theme id
|
2023-03-20 22:02:20 +00:00
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
String _themeId = "light";
|
2023-03-20 22:02:20 +00:00
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
String get themeId => _themeId;
|
2023-03-20 22:02:20 +00:00
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
set themeId(String themeId) {
|
|
|
|
if (this.themeId != themeId) {
|
2023-03-21 00:04:05 +00:00
|
|
|
DB.instance.put<dynamic>(
|
2023-05-09 20:20:29 +00:00
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "themeId",
|
|
|
|
value: themeId,
|
|
|
|
);
|
|
|
|
_themeId = themeId;
|
2023-03-21 00:04:05 +00:00
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
Future<String> _getThemeId() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "themeId",
|
|
|
|
) as String? ??
|
|
|
|
"light";
|
2023-03-21 00:04:05 +00:00
|
|
|
}
|
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
// current system brightness light theme id
|
2023-03-21 00:04:05 +00:00
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
String _systemBrightnessLightThemeId = "light";
|
2023-03-21 00:04:05 +00:00
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
String get systemBrightnessLightThemeId => _systemBrightnessLightThemeId;
|
2023-03-21 00:04:05 +00:00
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
set systemBrightnessLightThemeId(String systemBrightnessLightThemeId) {
|
|
|
|
if (this.systemBrightnessLightThemeId != systemBrightnessLightThemeId) {
|
2023-03-20 22:02:20 +00:00
|
|
|
DB.instance.put<dynamic>(
|
2023-05-09 20:20:29 +00:00
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "systemBrightnessLightThemeId",
|
|
|
|
value: systemBrightnessLightThemeId,
|
|
|
|
);
|
|
|
|
_systemBrightnessLightThemeId = systemBrightnessLightThemeId;
|
2023-03-20 22:02:20 +00:00
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
Future<String> _getSystemBrightnessLightThemeId() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "systemBrightnessLightThemeId",
|
|
|
|
) as String? ??
|
|
|
|
"light";
|
2023-03-20 22:02:20 +00:00
|
|
|
}
|
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
// current system brightness dark theme id
|
2023-03-20 22:02:20 +00:00
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
String _systemBrightnessDarkThemeId = "dark";
|
2023-03-20 22:02:20 +00:00
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
String get systemBrightnessDarkThemeId => _systemBrightnessDarkThemeId;
|
2023-03-20 22:02:20 +00:00
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
set systemBrightnessDarkThemeId(String systemBrightnessDarkThemeId) {
|
|
|
|
if (this.systemBrightnessDarkThemeId != systemBrightnessDarkThemeId) {
|
2023-03-20 22:02:20 +00:00
|
|
|
DB.instance.put<dynamic>(
|
2023-05-09 20:20:29 +00:00
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "systemBrightnessDarkThemeId",
|
|
|
|
value: systemBrightnessDarkThemeId,
|
|
|
|
);
|
|
|
|
_systemBrightnessDarkThemeId = systemBrightnessDarkThemeId;
|
2023-03-20 22:02:20 +00:00
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-09 20:20:29 +00:00
|
|
|
Future<String> _getSystemBrightnessDarkTheme() async {
|
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "systemBrightnessDarkThemeId",
|
|
|
|
) as String? ??
|
|
|
|
"dark";
|
2023-03-20 22:02:20 +00:00
|
|
|
}
|
2023-05-29 17:42:11 +00:00
|
|
|
|
|
|
|
// coin amount unit settings
|
|
|
|
|
|
|
|
final Map<Coin, AmountUnit> _amountUnits = {};
|
|
|
|
|
|
|
|
AmountUnit amountUnit(Coin coin) => _amountUnits[coin] ?? AmountUnit.normal;
|
|
|
|
|
|
|
|
void updateAmountUnit({required Coin coin, required AmountUnit amountUnit}) {
|
|
|
|
if (this.amountUnit(coin) != amountUnit) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "amountUnitFor${coin.name}",
|
|
|
|
value: amountUnit.index,
|
|
|
|
);
|
|
|
|
_amountUnits[coin] = amountUnit;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> _setAmountUnits() async {
|
|
|
|
for (final coin in Coin.values) {
|
|
|
|
final unitIndex = await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "amountUnitFor${coin.name}",
|
|
|
|
) as int? ??
|
|
|
|
0; // 0 is "normal"
|
|
|
|
_amountUnits[coin] = AmountUnit.values[unitIndex];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// coin precision setting (max decimal places to show)
|
|
|
|
|
|
|
|
final Map<Coin, int> _amountDecimals = {};
|
|
|
|
|
|
|
|
int maxDecimals(Coin coin) => _amountDecimals[coin] ?? coin.decimals;
|
|
|
|
|
|
|
|
void updateMaxDecimals({required Coin coin, required int maxDecimals}) {
|
|
|
|
if (this.maxDecimals(coin) != maxDecimals) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "maxDecimalsFor${coin.name}",
|
|
|
|
value: maxDecimals,
|
|
|
|
);
|
|
|
|
_amountDecimals[coin] = maxDecimals;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> _setMaxDecimals() async {
|
|
|
|
for (final coin in Coin.values) {
|
|
|
|
final decimals = await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "maxDecimalsFor${coin.name}",
|
|
|
|
) as int? ??
|
2023-06-07 19:17:49 +00:00
|
|
|
(coin.decimals > 18 ? 18 : coin.decimals);
|
|
|
|
// use some sane max rather than up to 30 that nano uses
|
2023-05-29 17:42:11 +00:00
|
|
|
_amountDecimals[coin] = decimals;
|
|
|
|
}
|
|
|
|
}
|
2023-08-07 17:06:44 +00:00
|
|
|
|
|
|
|
// enabled tor
|
|
|
|
|
|
|
|
bool _useTor = false;
|
|
|
|
|
|
|
|
bool get useTor => _useTor;
|
|
|
|
|
|
|
|
set useTor(bool useTor) {
|
|
|
|
if (_useTor != useTor) {
|
|
|
|
DB.instance.put<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "useTor",
|
|
|
|
value: useTor,
|
|
|
|
);
|
|
|
|
_useTor = useTor;
|
|
|
|
notifyListeners();
|
2023-09-07 15:20:45 +00:00
|
|
|
GlobalEventBus.instance.fire(
|
2023-09-07 20:37:23 +00:00
|
|
|
TorPreferenceChangedEvent(
|
2023-09-07 15:20:45 +00:00
|
|
|
status: useTor ? TorStatus.enabled : TorStatus.disabled,
|
|
|
|
message: "useTor updated in prefs",
|
|
|
|
),
|
|
|
|
);
|
2023-08-07 17:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _getUseTor() async {
|
2023-09-07 15:20:45 +00:00
|
|
|
return await DB.instance.get<dynamic>(
|
|
|
|
boxName: DB.boxNamePrefs,
|
|
|
|
key: "useTor",
|
|
|
|
) as bool? ??
|
2023-08-07 17:06:44 +00:00
|
|
|
false;
|
|
|
|
}
|
2022-08-26 08:11:35 +00:00
|
|
|
}
|