diff --git a/.metadata b/.metadata index d1551205d..675f4a740 100644 --- a/.metadata +++ b/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled. version: - revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + revision: f92f44110e87bad5ff168335c36da6f6053036e6 channel: stable project_type: app @@ -13,17 +13,11 @@ project_type: app migration: platforms: - platform: root - create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 - base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 - - platform: linux - create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 - base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + create_revision: f92f44110e87bad5ff168335c36da6f6053036e6 + base_revision: f92f44110e87bad5ff168335c36da6f6053036e6 - platform: macos - create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 - base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 - - platform: windows - create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 - base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + create_revision: f92f44110e87bad5ff168335c36da6f6053036e6 + base_revision: f92f44110e87bad5ff168335c36da6f6053036e6 # User provided section diff --git a/assets/icon/macos-icon.png b/assets/icon/macos-icon.png new file mode 100644 index 000000000..e4a263022 Binary files /dev/null and b/assets/icon/macos-icon.png differ diff --git a/crypto_plugins/flutter_libepiccash b/crypto_plugins/flutter_libepiccash index 3f9472225..f677dec0b 160000 --- a/crypto_plugins/flutter_libepiccash +++ b/crypto_plugins/flutter_libepiccash @@ -1 +1 @@ -Subproject commit 3f94722254d1c9ad54036e39a620ccc0bb53863b +Subproject commit f677dec0b34d3f9fe8fce2bc8ff5c508c3f3bb9a diff --git a/crypto_plugins/flutter_liblelantus b/crypto_plugins/flutter_liblelantus index ec3cf5e8e..9cd241b5e 160000 --- a/crypto_plugins/flutter_liblelantus +++ b/crypto_plugins/flutter_liblelantus @@ -1 +1 @@ -Subproject commit ec3cf5e8e1b90e006188aa8c323d4cd52dbfa9b9 +Subproject commit 9cd241b5ea142e21c01dd7639b42603281c43287 diff --git a/crypto_plugins/flutter_libmonero b/crypto_plugins/flutter_libmonero index 26a152fea..407425c9f 160000 --- a/crypto_plugins/flutter_libmonero +++ b/crypto_plugins/flutter_libmonero @@ -1 +1 @@ -Subproject commit 26a152fea3ca4b8c3f1130392a02f579c2ff218c +Subproject commit 407425c9fcf7a30c81f1345246c7225bc18b5cd5 diff --git a/docs/building.md b/docs/building.md index 6e71727ef..b56a87899 100644 --- a/docs/building.md +++ b/docs/building.md @@ -29,13 +29,6 @@ Then in `File > Settings > Plugins`, install the **Flutter** and **Dart** plugin Make a Pixel 4 (API 30) x86_64 emulator with 2GB of storage space for emulation -### Scripted setup - -[`scripts/setup.sh`](./../scripts/setup.sh) is provided as a tool to set up installation for building: download the script and run it anywhere. This script should skip the entire [Manual setup](#manual-setup) section below and prepare you for [running](#Running). - -### Manual setup -> If you used the `setup.sh` script, skip to [running](#Running) - Install basic dependencies ``` sudo apt-get install libssl-dev curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm python3-distutils @@ -98,20 +91,21 @@ cd .. ``` or manually by creating the files referenced in that script with the specified content. -### Building plugins for Android +### Build plugins +#### Building plugins for Android > Warning: This will take a long time, please be patient ``` cd scripts/android ./build_all.sh ``` -### Building plugins for Linux +#### Building plugins for Linux ``` cd scripts/linux ./build_all.sh ``` -### Building plugins for Windows +#### Building plugins for Windows ``` cd scripts/windows ./deps.sh @@ -140,10 +134,28 @@ flutter run linux Visual Studio is required for Windows development with the Flutter SDK. Download it at https://visualstudio.microsoft.com/downloads/ and install the "Desktop development with C++" workload, including all of its default components. ### Building libraries in WSL2 -Set up Ubuntu 20.04 in WSL2. Follow the entire Linux host section to get set up and build windows `dll` libraries. Copy the resulting `dll`s to their respective positions on the Windows host: +Set up Ubuntu 20.04 in WSL2. Follow the entire Linux host section in the WSL2 Ubuntu 20.04 host to get set up to build. You will also need to install Rust and MXE dependencies on the WSL2 Ubuntu 20.04 host: + - [Install Rust](https://rustup.rs/) + ```sh + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + ``` + - Install MXE by running `stack_wallet/scripts/windows/deps.sh` + ```sh + ./stack_wallet/scripts/windows/deps.sh + ``` + +The WSL2 host may optionally be navigated to the `stack_wallet` repository on the Windows host in order to build the plugins in-place and skip the next section in which you copy the `dll`s from WSL2 to Windows. Then build windows `dll` libraries by running the following script on the WSL2 Ubuntu 20.04 host: + +- `stack_wallet/scripts/windows/build_all.sh` + +Copy the resulting `dll`s to their respective positions on the Windows host: - `stack_wallet/crypto_plugins/flutter_libepiccash/scripts/windows/build/libepic_cash_wallet.dll` - `stack_wallet/crypto_plugins/flutter_liblelantus/scripts/windows/build/libmobileliblelantus.dll` + ### Install Flutter on Windows host diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 76dc00433..b2235ac27 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,6 +1,4 @@ PODS: - - "app_settings (3.0.0+1)": - - Flutter - barcode_scan2 (0.0.1): - Flutter - MTBBarcodeScanner @@ -112,7 +110,7 @@ PODS: - Flutter - flutter_native_splash (0.0.1): - Flutter - - flutter_secure_storage (3.3.1): + - flutter_secure_storage (6.0.0): - Flutter - integration_test (0.0.1): - Flutter @@ -149,7 +147,6 @@ PODS: - Flutter DEPENDENCIES: - - app_settings (from `.symlinks/plugins/app_settings/ios`) - barcode_scan2 (from `.symlinks/plugins/barcode_scan2/ios`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - cw_monero (from `.symlinks/plugins/cw_monero/ios`) @@ -169,10 +166,10 @@ DEPENDENCIES: - lelantus (from `.symlinks/plugins/lelantus/ios`) - local_auth (from `.symlinks/plugins/local_auth/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - share_plus (from `.symlinks/plugins/share_plus/ios`) - - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`) + - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - stack_wallet_backup (from `.symlinks/plugins/stack_wallet_backup/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - wakelock (from `.symlinks/plugins/wakelock/ios`) @@ -188,8 +185,6 @@ SPEC REPOS: - SwiftyGif EXTERNAL SOURCES: - app_settings: - :path: ".symlinks/plugins/app_settings/ios" barcode_scan2: :path: ".symlinks/plugins/barcode_scan2/ios" connectivity_plus: @@ -229,13 +224,13 @@ EXTERNAL SOURCES: package_info_plus: :path: ".symlinks/plugins/package_info_plus/ios" path_provider_foundation: - :path: ".symlinks/plugins/path_provider_foundation/ios" + :path: ".symlinks/plugins/path_provider_foundation/darwin" permission_handler_apple: :path: ".symlinks/plugins/permission_handler_apple/ios" share_plus: :path: ".symlinks/plugins/share_plus/ios" shared_preferences_foundation: - :path: ".symlinks/plugins/shared_preferences_foundation/ios" + :path: ".symlinks/plugins/shared_preferences_foundation/darwin" stack_wallet_backup: :path: ".symlinks/plugins/stack_wallet_backup/ios" url_launcher_ios: @@ -244,13 +239,12 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/wakelock/ios" SPEC CHECKSUMS: - app_settings: d103828c9f5d515c4df9ee754dabd443f7cedcf3 barcode_scan2: 0af2bb63c81b4565aab6cd78278e4c0fa136dbb0 - connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e + connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a cw_monero: 9816991daff0e3ad0a8be140e31933b5526babd4 cw_shared_external: 2972d872b8917603478117c9957dfca611845a92 cw_wownero: ac53899fa5c6ff46b3fb490aa3b7ca36301fa832 - device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed + device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea devicelocale: b22617f40038496deffba44747101255cee005b0 DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 @@ -260,23 +254,23 @@ SPEC CHECKSUMS: flutter_libmonero: da68a616b73dd0374a8419c684fa6b6df2c44ffe flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743 flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef - flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec - integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5 + flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be + integration_test: 13825b8a9334a850581300559b8839134b124670 isar_flutter_libs: b69f437aeab9c521821c3f376198c4371fa21073 lelantus: 417f0221260013dfc052cae9cf4b741b6479edba local_auth: 1740f55d7af0a2e2a8684ce225fe79d8931e808c MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb - package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e - path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852 + package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7 + path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8 permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 SDWebImage: 72f86271a6f3139cc7e4a89220946489d4b9a866 - share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68 - shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca + share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028 + shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c stack_wallet_backup: 5b8563aba5d8ffbf2ce1944331ff7294a0ec7c03 SwiftProtobuf: 6ef3f0e422ef90d6605ca20b21a94f6c1324d6b3 SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780 - url_launcher_ios: fb12c43172927bb5cf75aeebd073f883801f1993 + url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f PODFILE CHECKSUM: 57c8aed26fba39d3ec9424816221f294a07c58eb diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 4f2f20dc9..43e1486e6 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -242,6 +242,7 @@ files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -301,7 +302,6 @@ "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", "${BUILT_PRODUCTS_DIR}/SwiftProtobuf/SwiftProtobuf.framework", "${BUILT_PRODUCTS_DIR}/SwiftyGif/SwiftyGif.framework", - "${BUILT_PRODUCTS_DIR}/app_settings/app_settings.framework", "${BUILT_PRODUCTS_DIR}/barcode_scan2/barcode_scan2.framework", "${BUILT_PRODUCTS_DIR}/connectivity_plus/connectivity_plus.framework", "${BUILT_PRODUCTS_DIR}/cw_monero/cw_monero.framework", @@ -335,7 +335,6 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftProtobuf.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyGif.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/app_settings.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan2.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity_plus.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/cw_monero.framework", @@ -505,7 +504,10 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -692,7 +694,10 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -771,7 +776,10 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", diff --git a/lib/db/hive/db.dart b/lib/db/hive/db.dart index 42e938279..931a1cee4 100644 --- a/lib/db/hive/db.dart +++ b/lib/db/hive/db.dart @@ -13,7 +13,6 @@ import 'dart:isolate'; import 'package:cw_core/wallet_info.dart' as xmr; import 'package:hive/hive.dart'; import 'package:mutex/mutex.dart'; -import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'; import 'package:stackwallet/models/exchange/response_objects/trade.dart'; import 'package:stackwallet/models/node_model.dart'; import 'package:stackwallet/models/notification_model.dart'; @@ -23,8 +22,13 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; class DB { + // legacy (required for migrations) + @Deprecated("Left over for migration from old versions of Stack Wallet") static const String boxNameAddressBook = "addressBook"; - static const String boxNameDebugInfo = "debugInfoBox"; + static const String boxNameTrades = "exchangeTransactionsBox"; + + // in use + // TODO: migrate static const String boxNameNodeModels = "nodeModels"; static const String boxNamePrimaryNodes = "primaryNodes"; static const String boxNameAllWalletsData = "wallets"; @@ -32,33 +36,31 @@ class DB { static const String boxNameWatchedTransactions = "watchedTxNotificationModels"; static const String boxNameWatchedTrades = "watchedTradesNotificationModels"; - static const String boxNameTrades = "exchangeTransactionsBox"; static const String boxNameTradesV2 = "exchangeTradesBox"; static const String boxNameTradeNotes = "tradeNotesBox"; static const String boxNameTradeLookup = "tradeToTxidLookUpBox"; static const String boxNameFavoriteWallets = "favoriteWallets"; - static const String boxNamePrefs = "prefs"; static const String boxNameWalletsToDeleteOnStart = "walletsToDeleteOnStart"; static const String boxNamePriceCache = "priceAPIPrice24hCache"; - static const String boxNameDBInfo = "dbInfo"; - // static const String boxNameTheme = "theme"; - static const String boxNameDesktopData = "desktopData"; - static const String boxNameBuys = "buysBox"; - String boxNameTxCache({required Coin coin}) => "${coin.name}_txCache"; - String boxNameSetCache({required Coin coin}) => + // in use (keep for now) + static const String boxNameDBInfo = "dbInfo"; + static const String boxNamePrefs = "prefs"; + + String _boxNameTxCache({required Coin coin}) => "${coin.name}_txCache"; + + // firo only + String _boxNameSetCache({required Coin coin}) => "${coin.name}_anonymitySetCache"; - String boxNameUsedSerialsCache({required Coin coin}) => + String _boxNameUsedSerialsCache({required Coin coin}) => "${coin.name}_usedSerialsCache"; - Box? _boxDebugInfo; Box? _boxNodeModels; Box? _boxPrimaryNodes; Box? _boxAllWalletsData; Box? _boxNotifications; Box? _boxWatchedTransactions; Box? _boxWatchedTrades; - Box? _boxTrades; Box? _boxTradesV2; Box? _boxTradeNotes; Box? _boxFavoriteWallets; @@ -66,7 +68,7 @@ class DB { Box? _boxPrefs; Box? _boxTradeLookup; Box? _boxDBInfo; - Box? _boxDesktopData; + // Box? _boxDesktopData; final Map> _walletBoxes = {}; @@ -109,8 +111,6 @@ class DB { _boxPrefs = await Hive.openBox(boxNamePrefs); } - _boxDebugInfo = await Hive.openBox(boxNameDebugInfo); - if (Hive.isBoxOpen(boxNameNodeModels)) { _boxNodeModels = Hive.box(boxNameNodeModels); } else { @@ -129,19 +129,12 @@ class DB { _boxAllWalletsData = await Hive.openBox(boxNameAllWalletsData); } - if (Hive.isBoxOpen(boxNameDesktopData)) { - _boxDesktopData = Hive.box(boxNameDesktopData); - } else { - _boxDesktopData = await Hive.openBox(boxNameDesktopData); - } - _boxNotifications = await Hive.openBox(boxNameNotifications); _boxWatchedTransactions = await Hive.openBox(boxNameWatchedTransactions); _boxWatchedTrades = await Hive.openBox(boxNameWatchedTrades); - _boxTrades = await Hive.openBox(boxNameTrades); _boxTradesV2 = await Hive.openBox(boxNameTradesV2); _boxTradeNotes = await Hive.openBox(boxNameTradeNotes); _boxTradeLookup = await Hive.openBox(boxNameTradeLookup); @@ -152,7 +145,6 @@ class DB { await Future.wait([ Hive.openBox(boxNamePriceCache), _loadWalletBoxes(), - _loadSharedCoinCacheBoxes(), ]); } @@ -184,14 +176,39 @@ class DB { } } - Future _loadSharedCoinCacheBoxes() async { - for (final coin in Coin.values) { - _txCacheBoxes[coin] = - await Hive.openBox(boxNameTxCache(coin: coin)); - _setCacheBoxes[coin] = - await Hive.openBox(boxNameSetCache(coin: coin)); - _usedSerialsCacheBoxes[coin] = - await Hive.openBox(boxNameUsedSerialsCache(coin: coin)); + Future> getTxCacheBox({required Coin coin}) async { + return _txCacheBoxes[coin] ??= + await Hive.openBox(_boxNameTxCache(coin: coin)); + } + + Future closeTxCacheBox({required Coin coin}) async { + await _txCacheBoxes[coin]?.close(); + } + + Future> getAnonymitySetCacheBox({required Coin coin}) async { + return _setCacheBoxes[coin] ??= + await Hive.openBox(_boxNameSetCache(coin: coin)); + } + + Future closeAnonymitySetCacheBox({required Coin coin}) async { + await _setCacheBoxes[coin]?.close(); + } + + Future> getUsedSerialsCacheBox({required Coin coin}) async { + return _usedSerialsCacheBoxes[coin] ??= + await Hive.openBox(_boxNameUsedSerialsCache(coin: coin)); + } + + Future closeUsedSerialsCacheBox({required Coin coin}) async { + await _usedSerialsCacheBoxes[coin]?.close(); + } + + /// Clear all cached transactions for the specified coin + Future clearSharedTransactionCache({required Coin coin}) async { + await deleteAll(boxName: _boxNameTxCache(coin: coin)); + if (coin == Coin.firo) { + await deleteAll(boxName: _boxNameSetCache(coin: coin)); + await deleteAll(boxName: _boxNameUsedSerialsCache(coin: coin)); } } @@ -253,6 +270,36 @@ class DB { Future deleteBoxFromDisk({required String boxName}) async => await mutex.protect(() async => await Hive.deleteBoxFromDisk(boxName)); + + /////////////////////////////////////////////////////////////////////////// + Future deleteEverything() async { + try { + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameAddressBook); + await DB.instance.deleteBoxFromDisk(boxName: "debugInfoBox"); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameNodeModels); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNamePrimaryNodes); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameAllWalletsData); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameNotifications); + await DB.instance + .deleteBoxFromDisk(boxName: DB.boxNameWatchedTransactions); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameWatchedTrades); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTrades); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTradesV2); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTradeNotes); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTradeLookup); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameFavoriteWallets); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNamePrefs); + await DB.instance + .deleteBoxFromDisk(boxName: DB.boxNameWalletsToDeleteOnStart); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNamePriceCache); + await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameDBInfo); + await DB.instance.deleteBoxFromDisk(boxName: "theme"); + return true; + } catch (e, s) { + Logging.instance.log("$e $s", level: LogLevel.Error); + return false; + } + } } abstract class DBKeys { diff --git a/lib/db/isar/main_db.dart b/lib/db/isar/main_db.dart index ed73c398d..bb6ea5e8d 100644 --- a/lib/db/isar/main_db.dart +++ b/lib/db/isar/main_db.dart @@ -66,7 +66,7 @@ class MainDB { // contact entries List getContactEntries() { - return isar.contactEntrys.where().findAllSync(); + return isar.contactEntrys.where().sortByName().findAllSync(); } Future deleteContactEntry({required String id}) { diff --git a/lib/dto/ethereum/eth_token_tx_extra_dto.dart b/lib/dto/ethereum/eth_token_tx_extra_dto.dart index 144194914..aab41bb76 100644 --- a/lib/dto/ethereum/eth_token_tx_extra_dto.dart +++ b/lib/dto/ethereum/eth_token_tx_extra_dto.dart @@ -46,7 +46,7 @@ class EthTokenTxExtraDTO { ), gas: _amountFromJsonNum(map['gas']), gasPrice: _amountFromJsonNum(map['gasPrice']), - nonce: map['nonce'] as int, + nonce: map['nonce'] as int?, input: map['input'] as String, gasCost: _amountFromJsonNum(map['gasCost']), gasUsed: _amountFromJsonNum(map['gasUsed']), @@ -63,7 +63,7 @@ class EthTokenTxExtraDTO { final Amount gas; final Amount gasPrice; final String input; - final int nonce; + final int? nonce; final Amount gasCost; final Amount gasUsed; diff --git a/lib/dto/ethereum/eth_tx_dto.dart b/lib/dto/ethereum/eth_tx_dto.dart index 7289cda15..260675cf9 100644 --- a/lib/dto/ethereum/eth_tx_dto.dart +++ b/lib/dto/ethereum/eth_tx_dto.dart @@ -127,16 +127,16 @@ class EthTxDTO { map['timestamp'] = timestamp; map['from'] = from; map['to'] = to; - map['value'] = value; - map['gas'] = gas; - map['gasPrice'] = gasPrice; - map['maxFeePerGas'] = maxFeePerGas; - map['maxPriorityFeePerGas'] = maxPriorityFeePerGas; + map['value'] = value.toString(); + map['gas'] = gas.toString(); + map['gasPrice'] = gasPrice.toString(); + map['maxFeePerGas'] = maxFeePerGas.toString(); + map['maxPriorityFeePerGas'] = maxPriorityFeePerGas.toString(); map['isError'] = isError; map['hasToken'] = hasToken; map['compressedTx'] = compressedTx; - map['gasCost'] = gasCost; - map['gasUsed'] = gasUsed; + map['gasCost'] = gasCost.toString(); + map['gasUsed'] = gasUsed.toString(); return map; } diff --git a/lib/electrumx_rpc/cached_electrumx.dart b/lib/electrumx_rpc/cached_electrumx.dart index c3e6a9248..67f170bb4 100644 --- a/lib/electrumx_rpc/cached_electrumx.dart +++ b/lib/electrumx_rpc/cached_electrumx.dart @@ -38,9 +38,8 @@ class CachedElectrumX { required Coin coin, }) async { try { - final cachedSet = DB.instance.get( - boxName: DB.instance.boxNameSetCache(coin: coin), - key: groupId) as Map?; + final box = await DB.instance.getAnonymitySetCacheBox(coin: coin); + final cachedSet = box.get(groupId) as Map?; Map set; @@ -71,7 +70,7 @@ class CachedElectrumX { : newSet["blockHash"]; for (int i = (newSet["coins"] as List).length - 1; i >= 0; i--) { dynamic newCoin = newSet["coins"][i]; - List translatedCoin = []; + List translatedCoin = []; translatedCoin.add(!isHexadecimal(newCoin[0] as String) ? base64ToHex(newCoin[0] as String) : newCoin[0]); @@ -91,10 +90,7 @@ class CachedElectrumX { set["coins"].insert(0, translatedCoin); } // save set to db - await DB.instance.put( - boxName: DB.instance.boxNameSetCache(coin: coin), - key: groupId, - value: set); + await box.put(groupId, set); Logging.instance.log( "Updated current anonymity set for ${coin.name} with group ID $groupId", level: LogLevel.Info, @@ -130,8 +126,9 @@ class CachedElectrumX { bool verbose = true, }) async { try { - final cachedTx = DB.instance.get( - boxName: DB.instance.boxNameTxCache(coin: coin), key: txHash) as Map?; + final box = await DB.instance.getTxCacheBox(coin: coin); + + final cachedTx = box.get(txHash) as Map?; if (cachedTx == null) { final Map result = await electrumXClient .getTransaction(txHash: txHash, verbose: verbose); @@ -141,10 +138,7 @@ class CachedElectrumX { if (result["confirmations"] != null && result["confirmations"] as int > minCacheConfirms) { - await DB.instance.put( - boxName: DB.instance.boxNameTxCache(coin: coin), - key: txHash, - value: result); + await box.put(txHash, result); } Logging.instance.log("using fetched result", level: LogLevel.Info); @@ -166,9 +160,9 @@ class CachedElectrumX { int startNumber = 0, }) async { try { - final _list = DB.instance.get( - boxName: DB.instance.boxNameUsedSerialsCache(coin: coin), - key: "serials") as List?; + final box = await DB.instance.getUsedSerialsCacheBox(coin: coin); + + final _list = box.get("serials") as List?; List cachedSerials = _list == null ? [] : List.from(_list); @@ -188,10 +182,9 @@ class CachedElectrumX { } cachedSerials.addAll(newSerials); - await DB.instance.put( - boxName: DB.instance.boxNameUsedSerialsCache(coin: coin), - key: "serials", - value: cachedSerials, + await box.put( + "serials", + cachedSerials, ); return cachedSerials; @@ -205,11 +198,6 @@ class CachedElectrumX { /// Clear all cached transactions for the specified coin Future clearSharedTransactionCache({required Coin coin}) async { - await DB.instance - .deleteAll(boxName: DB.instance.boxNameTxCache(coin: coin)); - await DB.instance - .deleteAll(boxName: DB.instance.boxNameSetCache(coin: coin)); - await DB.instance.deleteAll( - boxName: DB.instance.boxNameUsedSerialsCache(coin: coin)); + await DB.instance.closeAnonymitySetCacheBox(coin: coin); } } diff --git a/lib/electrumx_rpc/electrumx.dart b/lib/electrumx_rpc/electrumx.dart index 4ee6dcaa4..e0a3118eb 100644 --- a/lib/electrumx_rpc/electrumx.dart +++ b/lib/electrumx_rpc/electrumx.dart @@ -146,7 +146,7 @@ class ElectrumX { throw response.exception!; } - if (response.data["error"] != null) { + if (response.data is Map && response.data["error"] != null) { if (response.data["error"] .toString() .contains("No such mempool or blockchain transaction")) { diff --git a/lib/main.dart b/lib/main.dart index b39f9db64..94c70c8b1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -167,6 +167,8 @@ void main() async { await Hive.openBox(DB.boxNamePrefs); await Prefs.instance.init(); + await StackFileSystem.initThemesDir(); + // Desktop migrate handled elsewhere (currently desktop_login_view.dart) if (!Util.isDesktop) { int dbVersion = DB.instance.get( @@ -312,7 +314,7 @@ class _MaterialAppWithThemeState extends ConsumerState } ref.read(applicationThemesDirectoryPathProvider.notifier).state = - (await StackFileSystem.applicationThemesDirectory()).path; + StackFileSystem.themesDir!.path; _notificationsService = ref.read(notificationsProvider); _nodeService = ref.read(nodeServiceChangeNotifierProvider); @@ -407,7 +409,7 @@ class _MaterialAppWithThemeState extends ConsumerState WidgetsBinding.instance.addPostFrameCallback((_) async { //Add themes path to provider ref.read(applicationThemesDirectoryPathProvider.notifier).state = - (await StackFileSystem.applicationThemesDirectory()).path; + StackFileSystem.themesDir!.path; ref.read(themeProvider.state).state = ref.read(pThemeService).getTheme( themeId: themeId, diff --git a/lib/models/isar/models/contact_entry.dart b/lib/models/isar/models/contact_entry.dart index 0ed9a8fb2..6289e8d18 100644 --- a/lib/models/isar/models/contact_entry.dart +++ b/lib/models/isar/models/contact_entry.dart @@ -33,6 +33,22 @@ class ContactEntry { @Index(unique: true, replace: true) late final String customId; + @ignore + List get addressesSorted { + final List sorted = []; + for (final coin in Coin.values) { + final slice = addresses.where((e) => e.coin == coin).toList(); + if (slice.isNotEmpty) { + slice.sort( + (a, b) => (a.other ?? a.label).compareTo(b.other ?? b.label), + ); + sorted.addAll(slice); + } + } + + return sorted; + } + ContactEntry copyWith({ bool shouldCopyEmojiWithNull = false, String? emojiChar, diff --git a/lib/models/isar/stack_theme.dart b/lib/models/isar/stack_theme.dart index 66a93ead4..c6d526d85 100644 --- a/lib/models/isar/stack_theme.dart +++ b/lib/models/isar/stack_theme.dart @@ -9,6 +9,7 @@ */ import 'dart:convert'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:isar/isar.dart'; @@ -17,6 +18,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/extensions/impl/box_shadow.dart'; import 'package:stackwallet/utilities/extensions/impl/gradient.dart'; import 'package:stackwallet/utilities/extensions/impl/string.dart'; +import 'package:stackwallet/utilities/stack_file_system.dart'; part 'stack_theme.g.dart'; @@ -1508,7 +1510,6 @@ class StackTheme { factory StackTheme.fromJson({ required Map json, - required String applicationThemesDirectoryPath, }) { final version = json["version"] as int? ?? 1; @@ -1517,21 +1518,18 @@ class StackTheme { ..assetsV1 = version == 1 ? ThemeAssets.fromJson( json: Map.from(json["assets"] as Map), - applicationThemesDirectoryPath: applicationThemesDirectoryPath, themeId: json["id"] as String, ) : null ..assetsV2 = version == 2 ? ThemeAssetsV2.fromJson( json: Map.from(json["assets"] as Map), - applicationThemesDirectoryPath: applicationThemesDirectoryPath, themeId: json["id"] as String, ) : null ..assetsV3 = version >= 3 ? ThemeAssetsV3.fromJson( json: Map.from(json["assets"] as Map), - applicationThemesDirectoryPath: applicationThemesDirectoryPath, themeId: json["id"] as String, ) : null @@ -1954,117 +1952,81 @@ class ThemeAssets implements IThemeAssets { factory ThemeAssets.fromJson({ required Map json, - required String applicationThemesDirectoryPath, required String themeId, }) { return ThemeAssets() - ..bellNew = - "$applicationThemesDirectoryPath/$themeId/assets/${json["bell_new"] as String}" - ..buy = - "$applicationThemesDirectoryPath/$themeId/assets/${json["buy"] as String}" - ..exchange = - "$applicationThemesDirectoryPath/$themeId/assets/${json["exchange"] as String}" + ..bellNew = "$themeId/assets/${json["bell_new"] as String}" + ..buy = "$themeId/assets/${json["buy"] as String}" + ..exchange = "$themeId/assets/${json["exchange"] as String}" ..personaIncognito = - "$applicationThemesDirectoryPath/$themeId/assets/${json["persona_incognito"] as String}" - ..personaEasy = - "$applicationThemesDirectoryPath/$themeId/assets/${json["persona_easy"] as String}" - ..stack = - "$applicationThemesDirectoryPath/$themeId/assets/${json["stack"] as String}" - ..stackIcon = - "$applicationThemesDirectoryPath/$themeId/assets/${json["stack_icon"] as String}" - ..receive = - "$applicationThemesDirectoryPath/$themeId/assets/${json["receive"] as String}" - ..receivePending = - "$applicationThemesDirectoryPath/$themeId/assets/${json["receive_pending"] as String}" + "$themeId/assets/${json["persona_incognito"] as String}" + ..personaEasy = "$themeId/assets/${json["persona_easy"] as String}" + ..stack = "$themeId/assets/${json["stack"] as String}" + ..stackIcon = "$themeId/assets/${json["stack_icon"] as String}" + ..receive = "$themeId/assets/${json["receive"] as String}" + ..receivePending = "$themeId/assets/${json["receive_pending"] as String}" ..receiveCancelled = - "$applicationThemesDirectoryPath/$themeId/assets/${json["receive_cancelled"] as String}" - ..send = - "$applicationThemesDirectoryPath/$themeId/assets/${json["send"] as String}" - ..sendPending = - "$applicationThemesDirectoryPath/$themeId/assets/${json["send_pending"] as String}" - ..sendCancelled = - "$applicationThemesDirectoryPath/$themeId/assets/${json["send_cancelled"] as String}" - ..themeSelector = - "$applicationThemesDirectoryPath/$themeId/assets/${json["theme_selector"] as String}" - ..themePreview = - "$applicationThemesDirectoryPath/$themeId/assets/${json["theme_preview"] as String}" - ..txExchange = - "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange"] as String}" + "$themeId/assets/${json["receive_cancelled"] as String}" + ..send = "$themeId/assets/${json["send"] as String}" + ..sendPending = "$themeId/assets/${json["send_pending"] as String}" + ..sendCancelled = "$themeId/assets/${json["send_cancelled"] as String}" + ..themeSelector = "$themeId/assets/${json["theme_selector"] as String}" + ..themePreview = "$themeId/assets/${json["theme_preview"] as String}" + ..txExchange = "$themeId/assets/${json["tx_exchange"] as String}" ..txExchangePending = - "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange_pending"] as String}" + "$themeId/assets/${json["tx_exchange_pending"] as String}" ..txExchangeFailed = - "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange_failed"] as String}" - ..bitcoin = - "$applicationThemesDirectoryPath/$themeId/assets/${json["bitcoin"] as String}" - ..litecoin = - "$applicationThemesDirectoryPath/$themeId/assets/${json["litecoin"] as String}" - ..bitcoincash = - "$applicationThemesDirectoryPath/$themeId/assets/${json["bitcoincash"] as String}" - ..dogecoin = - "$applicationThemesDirectoryPath/$themeId/assets/${json["dogecoin"] as String}" - ..epicCash = - "$applicationThemesDirectoryPath/$themeId/assets/${json["epicCash"] as String}" - ..ethereum = - "$applicationThemesDirectoryPath/$themeId/assets/${json["ethereum"] as String}" - ..firo = - "$applicationThemesDirectoryPath/$themeId/assets/${json["firo"] as String}" - ..monero = - "$applicationThemesDirectoryPath/$themeId/assets/${json["monero"] as String}" - ..wownero = - "$applicationThemesDirectoryPath/$themeId/assets/${json["wownero"] as String}" - ..namecoin = - "$applicationThemesDirectoryPath/$themeId/assets/${json["namecoin"] as String}" - ..particl = - "$applicationThemesDirectoryPath/$themeId/assets/${json["particl"] as String}" - ..bitcoinImage = - "$applicationThemesDirectoryPath/$themeId/assets/${json["bitcoin_image"] as String}" + "$themeId/assets/${json["tx_exchange_failed"] as String}" + ..bitcoin = "$themeId/assets/${json["bitcoin"] as String}" + ..litecoin = "$themeId/assets/${json["litecoin"] as String}" + ..bitcoincash = "$themeId/assets/${json["bitcoincash"] as String}" + ..dogecoin = "$themeId/assets/${json["dogecoin"] as String}" + ..epicCash = "$themeId/assets/${json["epicCash"] as String}" + ..ethereum = "$themeId/assets/${json["ethereum"] as String}" + ..firo = "$themeId/assets/${json["firo"] as String}" + ..monero = "$themeId/assets/${json["monero"] as String}" + ..wownero = "$themeId/assets/${json["wownero"] as String}" + ..namecoin = "$themeId/assets/${json["namecoin"] as String}" + ..particl = "$themeId/assets/${json["particl"] as String}" + ..bitcoinImage = "$themeId/assets/${json["bitcoin_image"] as String}" ..bitcoincashImage = - "$applicationThemesDirectoryPath/$themeId/assets/${json["bitcoincash_image"] as String}" - ..dogecoinImage = - "$applicationThemesDirectoryPath/$themeId/assets/${json["dogecoin_image"] as String}" - ..epicCashImage = - "$applicationThemesDirectoryPath/$themeId/assets/${json["epicCash_image"] as String}" - ..ethereumImage = - "$applicationThemesDirectoryPath/$themeId/assets/${json["ethereum_image"] as String}" - ..firoImage = - "$applicationThemesDirectoryPath/$themeId/assets/${json["firo_image"] as String}" - ..litecoinImage = - "$applicationThemesDirectoryPath/$themeId/assets/${json["litecoin_image"] as String}" - ..moneroImage = - "$applicationThemesDirectoryPath/$themeId/assets/${json["monero_image"] as String}" - ..wowneroImage = - "$applicationThemesDirectoryPath/$themeId/assets/${json["wownero_image"] as String}" - ..namecoinImage = - "$applicationThemesDirectoryPath/$themeId/assets/${json["namecoin_image"] as String}" - ..particlImage = - "$applicationThemesDirectoryPath/$themeId/assets/${json["particl_image"] as String}" + "$themeId/assets/${json["bitcoincash_image"] as String}" + ..dogecoinImage = "$themeId/assets/${json["dogecoin_image"] as String}" + ..epicCashImage = "$themeId/assets/${json["epicCash_image"] as String}" + ..ethereumImage = "$themeId/assets/${json["ethereum_image"] as String}" + ..firoImage = "$themeId/assets/${json["firo_image"] as String}" + ..litecoinImage = "$themeId/assets/${json["litecoin_image"] as String}" + ..moneroImage = "$themeId/assets/${json["monero_image"] as String}" + ..wowneroImage = "$themeId/assets/${json["wownero_image"] as String}" + ..namecoinImage = "$themeId/assets/${json["namecoin_image"] as String}" + ..particlImage = "$themeId/assets/${json["particl_image"] as String}" ..bitcoinImageSecondary = - "$applicationThemesDirectoryPath/$themeId/assets/${json["bitcoin_image_secondary"] as String}" + "$themeId/assets/${json["bitcoin_image_secondary"] as String}" ..bitcoincashImageSecondary = - "$applicationThemesDirectoryPath/$themeId/assets/${json["bitcoincash_image_secondary"] as String}" + "$themeId/assets/${json["bitcoincash_image_secondary"] as String}" ..dogecoinImageSecondary = - "$applicationThemesDirectoryPath/$themeId/assets/${json["dogecoin_image_secondary"] as String}" + "$themeId/assets/${json["dogecoin_image_secondary"] as String}" ..epicCashImageSecondary = - "$applicationThemesDirectoryPath/$themeId/assets/${json["epicCash_image_secondary"] as String}" + "$themeId/assets/${json["epicCash_image_secondary"] as String}" ..ethereumImageSecondary = - "$applicationThemesDirectoryPath/$themeId/assets/${json["ethereum_image_secondary"] as String}" + "$themeId/assets/${json["ethereum_image_secondary"] as String}" ..firoImageSecondary = - "$applicationThemesDirectoryPath/$themeId/assets/${json["firo_image_secondary"] as String}" + "$themeId/assets/${json["firo_image_secondary"] as String}" ..litecoinImageSecondary = - "$applicationThemesDirectoryPath/$themeId/assets/${json["litecoin_image_secondary"] as String}" + "$themeId/assets/${json["litecoin_image_secondary"] as String}" ..moneroImageSecondary = - "$applicationThemesDirectoryPath/$themeId/assets/${json["monero_image_secondary"] as String}" + "$themeId/assets/${json["monero_image_secondary"] as String}" ..wowneroImageSecondary = - "$applicationThemesDirectoryPath/$themeId/assets/${json["wownero_image_secondary"] as String}" + "$themeId/assets/${json["wownero_image_secondary"] as String}" ..namecoinImageSecondary = - "$applicationThemesDirectoryPath/$themeId/assets/${json["namecoin_image_secondary"] as String}" + "$themeId/assets/${json["namecoin_image_secondary"] as String}" ..particlImageSecondary = - "$applicationThemesDirectoryPath/$themeId/assets/${json["particl_image_secondary"] as String}" + "$themeId/assets/${json["particl_image_secondary"] as String}" ..loadingGif = json["loading_gif"] is String - ? "$applicationThemesDirectoryPath/$themeId/assets/${json["loading_gif"] as String}" + ? "$themeId/assets/${json["loading_gif"] as String}" : null ..background = json["background"] is String - ? "$applicationThemesDirectoryPath/$themeId/assets/${json["background"] as String}" + ? "$themeId/assets/${json["background"] as String}" : null; } } @@ -2146,65 +2108,50 @@ class ThemeAssetsV2 implements IThemeAssets { factory ThemeAssetsV2.fromJson({ required Map json, - required String applicationThemesDirectoryPath, required String themeId, }) { return ThemeAssetsV2() - ..bellNew = - "$applicationThemesDirectoryPath/$themeId/assets/${json["bell_new"] as String}" - ..buy = - "$applicationThemesDirectoryPath/$themeId/assets/${json["buy"] as String}" - ..exchange = - "$applicationThemesDirectoryPath/$themeId/assets/${json["exchange"] as String}" + ..bellNew = "$themeId/assets/${json["bell_new"] as String}" + ..buy = "$themeId/assets/${json["buy"] as String}" + ..exchange = "$themeId/assets/${json["exchange"] as String}" ..personaIncognito = - "$applicationThemesDirectoryPath/$themeId/assets/${json["persona_incognito"] as String}" - ..personaEasy = - "$applicationThemesDirectoryPath/$themeId/assets/${json["persona_easy"] as String}" - ..stack = - "$applicationThemesDirectoryPath/$themeId/assets/${json["stack"] as String}" - ..stackIcon = - "$applicationThemesDirectoryPath/$themeId/assets/${json["stack_icon"] as String}" - ..receive = - "$applicationThemesDirectoryPath/$themeId/assets/${json["receive"] as String}" - ..receivePending = - "$applicationThemesDirectoryPath/$themeId/assets/${json["receive_pending"] as String}" + "$themeId/assets/${json["persona_incognito"] as String}" + ..personaEasy = "$themeId/assets/${json["persona_easy"] as String}" + ..stack = "$themeId/assets/${json["stack"] as String}" + ..stackIcon = "$themeId/assets/${json["stack_icon"] as String}" + ..receive = "$themeId/assets/${json["receive"] as String}" + ..receivePending = "$themeId/assets/${json["receive_pending"] as String}" ..receiveCancelled = - "$applicationThemesDirectoryPath/$themeId/assets/${json["receive_cancelled"] as String}" - ..send = - "$applicationThemesDirectoryPath/$themeId/assets/${json["send"] as String}" - ..sendPending = - "$applicationThemesDirectoryPath/$themeId/assets/${json["send_pending"] as String}" - ..sendCancelled = - "$applicationThemesDirectoryPath/$themeId/assets/${json["send_cancelled"] as String}" - ..themeSelector = - "$applicationThemesDirectoryPath/$themeId/assets/${json["theme_selector"] as String}" - ..themePreview = - "$applicationThemesDirectoryPath/$themeId/assets/${json["theme_preview"] as String}" - ..txExchange = - "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange"] as String}" + "$themeId/assets/${json["receive_cancelled"] as String}" + ..send = "$themeId/assets/${json["send"] as String}" + ..sendPending = "$themeId/assets/${json["send_pending"] as String}" + ..sendCancelled = "$themeId/assets/${json["send_cancelled"] as String}" + ..themeSelector = "$themeId/assets/${json["theme_selector"] as String}" + ..themePreview = "$themeId/assets/${json["theme_preview"] as String}" + ..txExchange = "$themeId/assets/${json["tx_exchange"] as String}" ..txExchangePending = - "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange_pending"] as String}" + "$themeId/assets/${json["tx_exchange_pending"] as String}" ..txExchangeFailed = - "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange_failed"] as String}" + "$themeId/assets/${json["tx_exchange_failed"] as String}" ..coinPlaceholder = - "$applicationThemesDirectoryPath/$themeId/assets/${json["coin_placeholder"] as String}" + "$themeId/assets/${json["coin_placeholder"] as String}" ..coinIconsString = createCoinAssetsString( - "$applicationThemesDirectoryPath/$themeId/assets", + "$themeId/assets", Map.from(json["coins"]["icons"] as Map), ) ..coinImagesString = createCoinAssetsString( - "$applicationThemesDirectoryPath/$themeId/assets", + "$themeId/assets", Map.from(json["coins"]["images"] as Map), ) ..coinSecondaryImagesString = createCoinAssetsString( - "$applicationThemesDirectoryPath/$themeId/assets", + "$themeId/assets", Map.from(json["coins"]["secondaries"] as Map), ) ..loadingGif = json["loading_gif"] is String - ? "$applicationThemesDirectoryPath/$themeId/assets/${json["loading_gif"] as String}" + ? "$themeId/assets/${json["loading_gif"] as String}" : null ..background = json["background"] is String - ? "$applicationThemesDirectoryPath/$themeId/assets/${json["background"] as String}" + ? "$themeId/assets/${json["background"] as String}" : null; } @@ -2265,48 +2212,132 @@ class ThemeAssetsV2 implements IThemeAssets { @Embedded(inheritance: false) class ThemeAssetsV3 implements IThemeAssets { + @Name("bellNew") + late final String bellNewRelative; @override - late final String bellNew; - @override - late final String buy; - @override - late final String exchange; - @override - late final String personaIncognito; - @override - late final String personaEasy; - @override - late final String stack; - @override - late final String stackIcon; - @override - late final String receive; - @override - late final String receivePending; - @override - late final String receiveCancelled; - @override - late final String send; - @override - late final String sendPending; - @override - late final String sendCancelled; - @override - late final String themeSelector; - @override - late final String themePreview; - @override - late final String txExchange; - @override - late final String txExchangePending; - @override - late final String txExchangeFailed; - @override - late final String? loadingGif; - @override - late final String? background; + @ignore + String get bellNew => prependIfNeeded(bellNewRelative); - late final String coinPlaceholder; + @Name("buy") + late final String buyRelative; + @override + @ignore + String get buy => prependIfNeeded(buyRelative); + + @Name("exchange") + late final String exchangeRelative; + @override + @ignore + String get exchange => prependIfNeeded(exchangeRelative); + + @Name("personaIncognito") + late final String personaIncognitoRelative; + @override + @ignore + String get personaIncognito => prependIfNeeded(personaIncognitoRelative); + + @Name("personaEasy") + late final String personaEasyRelative; + @override + @ignore + String get personaEasy => prependIfNeeded(personaEasyRelative); + + @Name("stack") + late final String stackRelative; + @override + @ignore + String get stack => prependIfNeeded(stackRelative); + + @Name("stackIcon") + late final String stackIconRelative; + @override + @ignore + String get stackIcon => prependIfNeeded(stackIconRelative); + + @Name("receive") + late final String receiveRelative; + @override + @ignore + String get receive => prependIfNeeded(receiveRelative); + + @Name("receivePending") + late final String receivePendingRelative; + @override + @ignore + String get receivePending => prependIfNeeded(receivePendingRelative); + + @Name("receiveCancelled") + late final String receiveCancelledRelative; + @override + @ignore + String get receiveCancelled => prependIfNeeded(receiveCancelledRelative); + + @Name("send") + late final String sendRelative; + @override + @ignore + String get send => prependIfNeeded(sendRelative); + + @Name("sendPending") + late final String sendPendingRelative; + @override + @ignore + String get sendPending => prependIfNeeded(sendPendingRelative); + + @Name("sendCancelled") + late final String sendCancelledRelative; + @override + @ignore + String get sendCancelled => prependIfNeeded(sendCancelledRelative); + + @Name("themeSelector") + late final String themeSelectorRelative; + @override + @ignore + String get themeSelector => prependIfNeeded(themeSelectorRelative); + + @Name("themePreview") + late final String themePreviewRelative; + @override + @ignore + String get themePreview => prependIfNeeded(themePreviewRelative); + + @Name("txExchange") + late final String txExchangeRelative; + @override + @ignore + String get txExchange => prependIfNeeded(txExchangeRelative); + + @Name("txExchangePending") + late final String txExchangePendingRelative; + @override + @ignore + String get txExchangePending => prependIfNeeded(txExchangePendingRelative); + + @Name("txExchangeFailed") + late final String txExchangeFailedRelative; + @override + @ignore + String get txExchangeFailed => prependIfNeeded(txExchangeFailedRelative); + + @Name("loadingGif") + late final String? loadingGifRelative; + @override + @ignore + String? get loadingGif => + loadingGifRelative != null ? prependIfNeeded(loadingGifRelative!) : null; + + @Name("background") + late final String? backgroundRelative; + @override + @ignore + String? get background => + backgroundRelative != null ? prependIfNeeded(backgroundRelative!) : null; + + @Name("coinPlaceholder") + late final String coinPlaceholderRelative; + @ignore + String get coinPlaceholder => prependIfNeeded(coinPlaceholderRelative); // Added some future proof params in case we want to add anything else // This should provide some buffer in stead of creating assetsV4 etc @@ -2373,82 +2404,94 @@ class ThemeAssetsV3 implements IThemeAssets { factory ThemeAssetsV3.fromJson({ required Map json, - required String applicationThemesDirectoryPath, required String themeId, }) { return ThemeAssetsV3() - ..bellNew = - "$applicationThemesDirectoryPath/$themeId/assets/${json["bell_new"] as String}" - ..buy = - "$applicationThemesDirectoryPath/$themeId/assets/${json["buy"] as String}" - ..exchange = - "$applicationThemesDirectoryPath/$themeId/assets/${json["exchange"] as String}" - ..personaIncognito = - "$applicationThemesDirectoryPath/$themeId/assets/${json["persona_incognito"] as String}" - ..personaEasy = - "$applicationThemesDirectoryPath/$themeId/assets/${json["persona_easy"] as String}" - ..stack = - "$applicationThemesDirectoryPath/$themeId/assets/${json["stack"] as String}" - ..stackIcon = - "$applicationThemesDirectoryPath/$themeId/assets/${json["stack_icon"] as String}" - ..receive = - "$applicationThemesDirectoryPath/$themeId/assets/${json["receive"] as String}" - ..receivePending = - "$applicationThemesDirectoryPath/$themeId/assets/${json["receive_pending"] as String}" - ..receiveCancelled = - "$applicationThemesDirectoryPath/$themeId/assets/${json["receive_cancelled"] as String}" - ..send = - "$applicationThemesDirectoryPath/$themeId/assets/${json["send"] as String}" - ..sendPending = - "$applicationThemesDirectoryPath/$themeId/assets/${json["send_pending"] as String}" - ..sendCancelled = - "$applicationThemesDirectoryPath/$themeId/assets/${json["send_cancelled"] as String}" - ..themeSelector = - "$applicationThemesDirectoryPath/$themeId/assets/${json["theme_selector"] as String}" - ..themePreview = - "$applicationThemesDirectoryPath/$themeId/assets/${json["theme_preview"] as String}" - ..txExchange = - "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange"] as String}" - ..txExchangePending = - "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange_pending"] as String}" - ..txExchangeFailed = - "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange_failed"] as String}" - ..coinPlaceholder = - "$applicationThemesDirectoryPath/$themeId/assets/${json["coin_placeholder"] as String}" + ..bellNewRelative = "$themeId/assets/${json["bell_new"] as String}" + ..buyRelative = "$themeId/assets/${json["buy"] as String}" + ..exchangeRelative = "$themeId/assets/${json["exchange"] as String}" + ..personaIncognitoRelative = + "$themeId/assets/${json["persona_incognito"] as String}" + ..personaEasyRelative = + "$themeId/assets/${json["persona_easy"] as String}" + ..stackRelative = "$themeId/assets/${json["stack"] as String}" + ..stackIconRelative = "$themeId/assets/${json["stack_icon"] as String}" + ..receiveRelative = "$themeId/assets/${json["receive"] as String}" + ..receivePendingRelative = + "$themeId/assets/${json["receive_pending"] as String}" + ..receiveCancelledRelative = + "$themeId/assets/${json["receive_cancelled"] as String}" + ..sendRelative = "$themeId/assets/${json["send"] as String}" + ..sendPendingRelative = + "$themeId/assets/${json["send_pending"] as String}" + ..sendCancelledRelative = + "$themeId/assets/${json["send_cancelled"] as String}" + ..themeSelectorRelative = + "$themeId/assets/${json["theme_selector"] as String}" + ..themePreviewRelative = + "$themeId/assets/${json["theme_preview"] as String}" + ..txExchangeRelative = "$themeId/assets/${json["tx_exchange"] as String}" + ..txExchangePendingRelative = + "$themeId/assets/${json["tx_exchange_pending"] as String}" + ..txExchangeFailedRelative = + "$themeId/assets/${json["tx_exchange_failed"] as String}" + ..coinPlaceholderRelative = + "$themeId/assets/${json["coin_placeholder"] as String}" ..coinIconsString = createCoinAssetsString( - "$applicationThemesDirectoryPath/$themeId/assets", + "$themeId/assets", Map.from(json["coins"]["icons"] as Map), ) ..coinImagesString = createCoinAssetsString( - "$applicationThemesDirectoryPath/$themeId/assets", + "$themeId/assets", Map.from(json["coins"]["images"] as Map), ) ..coinSecondaryImagesString = createCoinAssetsString( - "$applicationThemesDirectoryPath/$themeId/assets", + "$themeId/assets", Map.from(json["coins"]["secondaries"] as Map), ) ..coinCardImagesString = json["coins"]["cards"] is Map ? createCoinAssetsString( - "$applicationThemesDirectoryPath/$themeId/assets", + "$themeId/assets", Map.from(json["coins"]["cards"] as Map), ) : null ..coinCardFavoritesImagesString = json["coins"]["favoriteCards"] is Map ? createCoinAssetsString( - "$applicationThemesDirectoryPath/$themeId/assets", + "$themeId/assets", Map.from(json["coins"]["favoriteCards"] as Map), ) : null - ..loadingGif = json["loading_gif"] is String - ? "$applicationThemesDirectoryPath/$themeId/assets/${json["loading_gif"] as String}" + ..loadingGifRelative = json["loading_gif"] is String + ? "$themeId/assets/${json["loading_gif"] as String}" : null - ..background = json["background"] is String - ? "$applicationThemesDirectoryPath/$themeId/assets/${json["background"] as String}" + ..backgroundRelative = json["background"] is String + ? "$themeId/assets/${json["background"] as String}" : null + ..dummy1 = null ..dummy2 = null ..dummy3 = null; } + static String prependIfNeeded(String relativePath) { + final path = StackFileSystem.themesDir!.path; + + if (relativePath.startsWith(path)) { + return relativePath; + } else { + if (Platform.isIOS) { + const pattern = "/var/mobile/Containers/Data/Application/"; + if (relativePath.startsWith(pattern)) { + final parts = relativePath.split("/Library/themes/"); + if (parts.isNotEmpty) { + return "$path/${parts.last}"; + } + } + } + + return "$path/$relativePath"; + } + } + static String createCoinAssetsString(String path, Map json) { final Map map = {}; for (final entry in json.entries) { @@ -2468,6 +2511,8 @@ class ThemeAssetsV3 implements IThemeAssets { for (final coin in Coin.values) { result[coin] = map[coin.name] as String? ?? placeHolder; + + result[coin] = prependIfNeeded(result[coin]!); } return result; @@ -2500,7 +2545,7 @@ class ThemeAssetsV3 implements IThemeAssets { 'coinIcons: $coinIcons, ' 'coinImages: $coinImages, ' 'coinSecondaryImages: $coinSecondaryImages, ' - 'coinCardWalletImages: $coinCardImages' + 'coinCardImages: $coinCardImages' 'coinCardFavoritesImages: $coinCardFavoritesImages' ')'; } diff --git a/lib/models/isar/stack_theme.g.dart b/lib/models/isar/stack_theme.g.dart index 5810282d0..03c543ff0 100644 --- a/lib/models/isar/stack_theme.g.dart +++ b/lib/models/isar/stack_theme.g.dart @@ -29601,13 +29601,13 @@ int _themeAssetsV3EstimateSize( ) { var bytesCount = offsets.last; { - final value = object.background; + final value = object.backgroundRelative; if (value != null) { bytesCount += 3 + value.length * 3; } } - bytesCount += 3 + object.bellNew.length * 3; - bytesCount += 3 + object.buy.length * 3; + bytesCount += 3 + object.bellNewRelative.length * 3; + bytesCount += 3 + object.buyRelative.length * 3; { final value = object.coinCardImagesString; if (value != null) { @@ -29616,11 +29616,11 @@ int _themeAssetsV3EstimateSize( } bytesCount += 3 + object.coinIconsString.length * 3; bytesCount += 3 + object.coinImagesString.length * 3; - bytesCount += 3 + object.coinPlaceholder.length * 3; + bytesCount += 3 + object.coinPlaceholderRelative.length * 3; bytesCount += 3 + object.coinSecondaryImagesString.length * 3; - bytesCount += 3 + object.exchange.length * 3; + bytesCount += 3 + object.exchangeRelative.length * 3; { - final value = object.loadingGif; + final value = object.loadingGifRelative; if (value != null) { bytesCount += 3 + value.length * 3; } @@ -29643,21 +29643,21 @@ int _themeAssetsV3EstimateSize( bytesCount += 3 + value.length * 3; } } - bytesCount += 3 + object.personaEasy.length * 3; - bytesCount += 3 + object.personaIncognito.length * 3; - bytesCount += 3 + object.receive.length * 3; - bytesCount += 3 + object.receiveCancelled.length * 3; - bytesCount += 3 + object.receivePending.length * 3; - bytesCount += 3 + object.send.length * 3; - bytesCount += 3 + object.sendCancelled.length * 3; - bytesCount += 3 + object.sendPending.length * 3; - bytesCount += 3 + object.stack.length * 3; - bytesCount += 3 + object.stackIcon.length * 3; - bytesCount += 3 + object.themePreview.length * 3; - bytesCount += 3 + object.themeSelector.length * 3; - bytesCount += 3 + object.txExchange.length * 3; - bytesCount += 3 + object.txExchangeFailed.length * 3; - bytesCount += 3 + object.txExchangePending.length * 3; + bytesCount += 3 + object.personaEasyRelative.length * 3; + bytesCount += 3 + object.personaIncognitoRelative.length * 3; + bytesCount += 3 + object.receiveRelative.length * 3; + bytesCount += 3 + object.receiveCancelledRelative.length * 3; + bytesCount += 3 + object.receivePendingRelative.length * 3; + bytesCount += 3 + object.sendRelative.length * 3; + bytesCount += 3 + object.sendCancelledRelative.length * 3; + bytesCount += 3 + object.sendPendingRelative.length * 3; + bytesCount += 3 + object.stackRelative.length * 3; + bytesCount += 3 + object.stackIconRelative.length * 3; + bytesCount += 3 + object.themePreviewRelative.length * 3; + bytesCount += 3 + object.themeSelectorRelative.length * 3; + bytesCount += 3 + object.txExchangeRelative.length * 3; + bytesCount += 3 + object.txExchangeFailedRelative.length * 3; + bytesCount += 3 + object.txExchangePendingRelative.length * 3; return bytesCount; } @@ -29667,34 +29667,34 @@ void _themeAssetsV3Serialize( List offsets, Map> allOffsets, ) { - writer.writeString(offsets[0], object.background); - writer.writeString(offsets[1], object.bellNew); - writer.writeString(offsets[2], object.buy); + writer.writeString(offsets[0], object.backgroundRelative); + writer.writeString(offsets[1], object.bellNewRelative); + writer.writeString(offsets[2], object.buyRelative); writer.writeString(offsets[3], object.coinCardImagesString); writer.writeString(offsets[4], object.coinIconsString); writer.writeString(offsets[5], object.coinImagesString); - writer.writeString(offsets[6], object.coinPlaceholder); + writer.writeString(offsets[6], object.coinPlaceholderRelative); writer.writeString(offsets[7], object.coinSecondaryImagesString); - writer.writeString(offsets[8], object.exchange); - writer.writeString(offsets[9], object.loadingGif); + writer.writeString(offsets[8], object.exchangeRelative); + writer.writeString(offsets[9], object.loadingGifRelative); writer.writeString(offsets[10], object.coinCardFavoritesImagesString); writer.writeString(offsets[11], object.dummy2); writer.writeString(offsets[12], object.dummy3); - writer.writeString(offsets[13], object.personaEasy); - writer.writeString(offsets[14], object.personaIncognito); - writer.writeString(offsets[15], object.receive); - writer.writeString(offsets[16], object.receiveCancelled); - writer.writeString(offsets[17], object.receivePending); - writer.writeString(offsets[18], object.send); - writer.writeString(offsets[19], object.sendCancelled); - writer.writeString(offsets[20], object.sendPending); - writer.writeString(offsets[21], object.stack); - writer.writeString(offsets[22], object.stackIcon); - writer.writeString(offsets[23], object.themePreview); - writer.writeString(offsets[24], object.themeSelector); - writer.writeString(offsets[25], object.txExchange); - writer.writeString(offsets[26], object.txExchangeFailed); - writer.writeString(offsets[27], object.txExchangePending); + writer.writeString(offsets[13], object.personaEasyRelative); + writer.writeString(offsets[14], object.personaIncognitoRelative); + writer.writeString(offsets[15], object.receiveRelative); + writer.writeString(offsets[16], object.receiveCancelledRelative); + writer.writeString(offsets[17], object.receivePendingRelative); + writer.writeString(offsets[18], object.sendRelative); + writer.writeString(offsets[19], object.sendCancelledRelative); + writer.writeString(offsets[20], object.sendPendingRelative); + writer.writeString(offsets[21], object.stackRelative); + writer.writeString(offsets[22], object.stackIconRelative); + writer.writeString(offsets[23], object.themePreviewRelative); + writer.writeString(offsets[24], object.themeSelectorRelative); + writer.writeString(offsets[25], object.txExchangeRelative); + writer.writeString(offsets[26], object.txExchangeFailedRelative); + writer.writeString(offsets[27], object.txExchangePendingRelative); } ThemeAssetsV3 _themeAssetsV3Deserialize( @@ -29704,34 +29704,34 @@ ThemeAssetsV3 _themeAssetsV3Deserialize( Map> allOffsets, ) { final object = ThemeAssetsV3(); - object.background = reader.readStringOrNull(offsets[0]); - object.bellNew = reader.readString(offsets[1]); - object.buy = reader.readString(offsets[2]); + object.backgroundRelative = reader.readStringOrNull(offsets[0]); + object.bellNewRelative = reader.readString(offsets[1]); + object.buyRelative = reader.readString(offsets[2]); object.coinCardImagesString = reader.readStringOrNull(offsets[3]); object.coinIconsString = reader.readString(offsets[4]); object.coinImagesString = reader.readString(offsets[5]); - object.coinPlaceholder = reader.readString(offsets[6]); + object.coinPlaceholderRelative = reader.readString(offsets[6]); object.coinSecondaryImagesString = reader.readString(offsets[7]); - object.exchange = reader.readString(offsets[8]); - object.loadingGif = reader.readStringOrNull(offsets[9]); + object.exchangeRelative = reader.readString(offsets[8]); + object.loadingGifRelative = reader.readStringOrNull(offsets[9]); object.coinCardFavoritesImagesString = reader.readStringOrNull(offsets[10]); object.dummy2 = reader.readStringOrNull(offsets[11]); object.dummy3 = reader.readStringOrNull(offsets[12]); - object.personaEasy = reader.readString(offsets[13]); - object.personaIncognito = reader.readString(offsets[14]); - object.receive = reader.readString(offsets[15]); - object.receiveCancelled = reader.readString(offsets[16]); - object.receivePending = reader.readString(offsets[17]); - object.send = reader.readString(offsets[18]); - object.sendCancelled = reader.readString(offsets[19]); - object.sendPending = reader.readString(offsets[20]); - object.stack = reader.readString(offsets[21]); - object.stackIcon = reader.readString(offsets[22]); - object.themePreview = reader.readString(offsets[23]); - object.themeSelector = reader.readString(offsets[24]); - object.txExchange = reader.readString(offsets[25]); - object.txExchangeFailed = reader.readString(offsets[26]); - object.txExchangePending = reader.readString(offsets[27]); + object.personaEasyRelative = reader.readString(offsets[13]); + object.personaIncognitoRelative = reader.readString(offsets[14]); + object.receiveRelative = reader.readString(offsets[15]); + object.receiveCancelledRelative = reader.readString(offsets[16]); + object.receivePendingRelative = reader.readString(offsets[17]); + object.sendRelative = reader.readString(offsets[18]); + object.sendCancelledRelative = reader.readString(offsets[19]); + object.sendPendingRelative = reader.readString(offsets[20]); + object.stackRelative = reader.readString(offsets[21]); + object.stackIconRelative = reader.readString(offsets[22]); + object.themePreviewRelative = reader.readString(offsets[23]); + object.themeSelectorRelative = reader.readString(offsets[24]); + object.txExchangeRelative = reader.readString(offsets[25]); + object.txExchangeFailedRelative = reader.readString(offsets[26]); + object.txExchangePendingRelative = reader.readString(offsets[27]); return object; } @@ -29806,7 +29806,7 @@ P _themeAssetsV3DeserializeProp

( extension ThemeAssetsV3QueryFilter on QueryBuilder { QueryBuilder - backgroundIsNull() { + backgroundRelativeIsNull() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(const FilterCondition.isNull( property: r'background', @@ -29815,7 +29815,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - backgroundIsNotNull() { + backgroundRelativeIsNotNull() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(const FilterCondition.isNotNull( property: r'background', @@ -29824,7 +29824,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - backgroundEqualTo( + backgroundRelativeEqualTo( String? value, { bool caseSensitive = true, }) { @@ -29838,7 +29838,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - backgroundGreaterThan( + backgroundRelativeGreaterThan( String? value, { bool include = false, bool caseSensitive = true, @@ -29854,7 +29854,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - backgroundLessThan( + backgroundRelativeLessThan( String? value, { bool include = false, bool caseSensitive = true, @@ -29870,7 +29870,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - backgroundBetween( + backgroundRelativeBetween( String? lower, String? upper, { bool includeLower = true, @@ -29890,7 +29890,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - backgroundStartsWith( + backgroundRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -29904,7 +29904,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - backgroundEndsWith( + backgroundRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -29918,7 +29918,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - backgroundContains(String value, {bool caseSensitive = true}) { + backgroundRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'background', @@ -29929,7 +29929,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - backgroundMatches(String pattern, {bool caseSensitive = true}) { + backgroundRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'background', @@ -29940,7 +29940,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - backgroundIsEmpty() { + backgroundRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'background', @@ -29950,7 +29950,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - backgroundIsNotEmpty() { + backgroundRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'background', @@ -29960,7 +29960,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - bellNewEqualTo( + bellNewRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -29974,7 +29974,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - bellNewGreaterThan( + bellNewRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -29990,7 +29990,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - bellNewLessThan( + bellNewRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -30006,7 +30006,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - bellNewBetween( + bellNewRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -30026,7 +30026,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - bellNewStartsWith( + bellNewRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -30040,7 +30040,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - bellNewEndsWith( + bellNewRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -30054,7 +30054,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - bellNewContains(String value, {bool caseSensitive = true}) { + bellNewRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'bellNew', @@ -30065,7 +30065,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - bellNewMatches(String pattern, {bool caseSensitive = true}) { + bellNewRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'bellNew', @@ -30076,7 +30076,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - bellNewIsEmpty() { + bellNewRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'bellNew', @@ -30086,7 +30086,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - bellNewIsNotEmpty() { + bellNewRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'bellNew', @@ -30095,7 +30095,8 @@ extension ThemeAssetsV3QueryFilter }); } - QueryBuilder buyEqualTo( + QueryBuilder + buyRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -30109,7 +30110,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - buyGreaterThan( + buyRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -30124,7 +30125,8 @@ extension ThemeAssetsV3QueryFilter }); } - QueryBuilder buyLessThan( + QueryBuilder + buyRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -30139,7 +30141,8 @@ extension ThemeAssetsV3QueryFilter }); } - QueryBuilder buyBetween( + QueryBuilder + buyRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -30159,7 +30162,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - buyStartsWith( + buyRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -30172,7 +30175,8 @@ extension ThemeAssetsV3QueryFilter }); } - QueryBuilder buyEndsWith( + QueryBuilder + buyRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -30185,9 +30189,8 @@ extension ThemeAssetsV3QueryFilter }); } - QueryBuilder buyContains( - String value, - {bool caseSensitive = true}) { + QueryBuilder + buyRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'buy', @@ -30197,9 +30200,8 @@ extension ThemeAssetsV3QueryFilter }); } - QueryBuilder buyMatches( - String pattern, - {bool caseSensitive = true}) { + QueryBuilder + buyRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'buy', @@ -30210,7 +30212,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - buyIsEmpty() { + buyRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'buy', @@ -30220,7 +30222,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - buyIsNotEmpty() { + buyRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'buy', @@ -30656,7 +30658,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - coinPlaceholderEqualTo( + coinPlaceholderRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -30670,7 +30672,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - coinPlaceholderGreaterThan( + coinPlaceholderRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -30686,7 +30688,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - coinPlaceholderLessThan( + coinPlaceholderRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -30702,7 +30704,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - coinPlaceholderBetween( + coinPlaceholderRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -30722,7 +30724,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - coinPlaceholderStartsWith( + coinPlaceholderRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -30736,7 +30738,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - coinPlaceholderEndsWith( + coinPlaceholderRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -30750,7 +30752,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - coinPlaceholderContains(String value, {bool caseSensitive = true}) { + coinPlaceholderRelativeContains(String value, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'coinPlaceholder', @@ -30761,7 +30764,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - coinPlaceholderMatches(String pattern, {bool caseSensitive = true}) { + coinPlaceholderRelativeMatches(String pattern, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'coinPlaceholder', @@ -30772,7 +30776,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - coinPlaceholderIsEmpty() { + coinPlaceholderRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'coinPlaceholder', @@ -30782,7 +30786,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - coinPlaceholderIsNotEmpty() { + coinPlaceholderRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'coinPlaceholder', @@ -30930,7 +30934,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - exchangeEqualTo( + exchangeRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -30944,7 +30948,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - exchangeGreaterThan( + exchangeRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -30960,7 +30964,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - exchangeLessThan( + exchangeRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -30976,7 +30980,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - exchangeBetween( + exchangeRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -30996,7 +31000,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - exchangeStartsWith( + exchangeRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -31010,7 +31014,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - exchangeEndsWith( + exchangeRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -31024,7 +31028,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - exchangeContains(String value, {bool caseSensitive = true}) { + exchangeRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'exchange', @@ -31035,7 +31039,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - exchangeMatches(String pattern, {bool caseSensitive = true}) { + exchangeRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'exchange', @@ -31046,7 +31050,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - exchangeIsEmpty() { + exchangeRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'exchange', @@ -31056,7 +31060,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - exchangeIsNotEmpty() { + exchangeRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'exchange', @@ -31066,7 +31070,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifIsNull() { + loadingGifRelativeIsNull() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(const FilterCondition.isNull( property: r'loadingGif', @@ -31075,7 +31079,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifIsNotNull() { + loadingGifRelativeIsNotNull() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(const FilterCondition.isNotNull( property: r'loadingGif', @@ -31084,7 +31088,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifEqualTo( + loadingGifRelativeEqualTo( String? value, { bool caseSensitive = true, }) { @@ -31098,7 +31102,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifGreaterThan( + loadingGifRelativeGreaterThan( String? value, { bool include = false, bool caseSensitive = true, @@ -31114,7 +31118,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifLessThan( + loadingGifRelativeLessThan( String? value, { bool include = false, bool caseSensitive = true, @@ -31130,7 +31134,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifBetween( + loadingGifRelativeBetween( String? lower, String? upper, { bool includeLower = true, @@ -31150,7 +31154,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifStartsWith( + loadingGifRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -31164,7 +31168,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifEndsWith( + loadingGifRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -31178,7 +31182,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifContains(String value, {bool caseSensitive = true}) { + loadingGifRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'loadingGif', @@ -31189,7 +31193,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifMatches(String pattern, {bool caseSensitive = true}) { + loadingGifRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'loadingGif', @@ -31200,7 +31204,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifIsEmpty() { + loadingGifRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'loadingGif', @@ -31210,7 +31214,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - loadingGifIsNotEmpty() { + loadingGifRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'loadingGif', @@ -31684,7 +31688,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaEasyEqualTo( + personaEasyRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -31698,7 +31702,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaEasyGreaterThan( + personaEasyRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -31714,7 +31718,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaEasyLessThan( + personaEasyRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -31730,7 +31734,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaEasyBetween( + personaEasyRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -31750,7 +31754,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaEasyStartsWith( + personaEasyRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -31764,7 +31768,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaEasyEndsWith( + personaEasyRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -31778,7 +31782,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaEasyContains(String value, {bool caseSensitive = true}) { + personaEasyRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'personaEasy', @@ -31789,7 +31793,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaEasyMatches(String pattern, {bool caseSensitive = true}) { + personaEasyRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'personaEasy', @@ -31800,7 +31804,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaEasyIsEmpty() { + personaEasyRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'personaEasy', @@ -31810,7 +31814,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaEasyIsNotEmpty() { + personaEasyRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'personaEasy', @@ -31820,7 +31824,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaIncognitoEqualTo( + personaIncognitoRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -31834,7 +31838,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaIncognitoGreaterThan( + personaIncognitoRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -31850,7 +31854,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaIncognitoLessThan( + personaIncognitoRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -31866,7 +31870,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaIncognitoBetween( + personaIncognitoRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -31886,7 +31890,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaIncognitoStartsWith( + personaIncognitoRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -31900,7 +31904,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaIncognitoEndsWith( + personaIncognitoRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -31914,7 +31918,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaIncognitoContains(String value, {bool caseSensitive = true}) { + personaIncognitoRelativeContains(String value, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'personaIncognito', @@ -31925,7 +31930,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaIncognitoMatches(String pattern, {bool caseSensitive = true}) { + personaIncognitoRelativeMatches(String pattern, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'personaIncognito', @@ -31936,7 +31942,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaIncognitoIsEmpty() { + personaIncognitoRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'personaIncognito', @@ -31946,7 +31952,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - personaIncognitoIsNotEmpty() { + personaIncognitoRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'personaIncognito', @@ -31956,7 +31962,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveEqualTo( + receiveRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -31970,7 +31976,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveGreaterThan( + receiveRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -31986,7 +31992,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveLessThan( + receiveRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -32002,7 +32008,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveBetween( + receiveRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32022,7 +32028,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveStartsWith( + receiveRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -32036,7 +32042,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveEndsWith( + receiveRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -32050,7 +32056,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveContains(String value, {bool caseSensitive = true}) { + receiveRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'receive', @@ -32061,7 +32067,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveMatches(String pattern, {bool caseSensitive = true}) { + receiveRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'receive', @@ -32072,7 +32078,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveIsEmpty() { + receiveRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'receive', @@ -32082,7 +32088,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveIsNotEmpty() { + receiveRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'receive', @@ -32092,7 +32098,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveCancelledEqualTo( + receiveCancelledRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -32106,7 +32112,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveCancelledGreaterThan( + receiveCancelledRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -32122,7 +32128,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveCancelledLessThan( + receiveCancelledRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -32138,7 +32144,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveCancelledBetween( + receiveCancelledRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32158,7 +32164,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveCancelledStartsWith( + receiveCancelledRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -32172,7 +32178,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveCancelledEndsWith( + receiveCancelledRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -32186,7 +32192,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveCancelledContains(String value, {bool caseSensitive = true}) { + receiveCancelledRelativeContains(String value, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'receiveCancelled', @@ -32197,7 +32204,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveCancelledMatches(String pattern, {bool caseSensitive = true}) { + receiveCancelledRelativeMatches(String pattern, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'receiveCancelled', @@ -32208,7 +32216,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveCancelledIsEmpty() { + receiveCancelledRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'receiveCancelled', @@ -32218,7 +32226,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receiveCancelledIsNotEmpty() { + receiveCancelledRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'receiveCancelled', @@ -32228,7 +32236,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receivePendingEqualTo( + receivePendingRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -32242,7 +32250,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receivePendingGreaterThan( + receivePendingRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -32258,7 +32266,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receivePendingLessThan( + receivePendingRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -32274,7 +32282,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receivePendingBetween( + receivePendingRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32294,7 +32302,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receivePendingStartsWith( + receivePendingRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -32308,7 +32316,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receivePendingEndsWith( + receivePendingRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -32322,7 +32330,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receivePendingContains(String value, {bool caseSensitive = true}) { + receivePendingRelativeContains(String value, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'receivePending', @@ -32333,7 +32342,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receivePendingMatches(String pattern, {bool caseSensitive = true}) { + receivePendingRelativeMatches(String pattern, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'receivePending', @@ -32344,7 +32354,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receivePendingIsEmpty() { + receivePendingRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'receivePending', @@ -32354,7 +32364,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - receivePendingIsNotEmpty() { + receivePendingRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'receivePending', @@ -32363,7 +32373,8 @@ extension ThemeAssetsV3QueryFilter }); } - QueryBuilder sendEqualTo( + QueryBuilder + sendRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -32377,7 +32388,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendGreaterThan( + sendRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -32393,7 +32404,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendLessThan( + sendRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -32408,7 +32419,8 @@ extension ThemeAssetsV3QueryFilter }); } - QueryBuilder sendBetween( + QueryBuilder + sendRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32428,7 +32440,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendStartsWith( + sendRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -32442,7 +32454,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendEndsWith( + sendRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -32456,7 +32468,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendContains(String value, {bool caseSensitive = true}) { + sendRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'send', @@ -32466,9 +32478,8 @@ extension ThemeAssetsV3QueryFilter }); } - QueryBuilder sendMatches( - String pattern, - {bool caseSensitive = true}) { + QueryBuilder + sendRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'send', @@ -32479,7 +32490,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendIsEmpty() { + sendRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'send', @@ -32489,7 +32500,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendIsNotEmpty() { + sendRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'send', @@ -32499,7 +32510,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendCancelledEqualTo( + sendCancelledRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -32513,7 +32524,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendCancelledGreaterThan( + sendCancelledRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -32529,7 +32540,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendCancelledLessThan( + sendCancelledRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -32545,7 +32556,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendCancelledBetween( + sendCancelledRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32565,7 +32576,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendCancelledStartsWith( + sendCancelledRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -32579,7 +32590,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendCancelledEndsWith( + sendCancelledRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -32593,7 +32604,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendCancelledContains(String value, {bool caseSensitive = true}) { + sendCancelledRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'sendCancelled', @@ -32604,7 +32615,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendCancelledMatches(String pattern, {bool caseSensitive = true}) { + sendCancelledRelativeMatches(String pattern, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'sendCancelled', @@ -32615,7 +32627,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendCancelledIsEmpty() { + sendCancelledRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'sendCancelled', @@ -32625,7 +32637,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendCancelledIsNotEmpty() { + sendCancelledRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'sendCancelled', @@ -32635,7 +32647,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendPendingEqualTo( + sendPendingRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -32649,7 +32661,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendPendingGreaterThan( + sendPendingRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -32665,7 +32677,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendPendingLessThan( + sendPendingRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -32681,7 +32693,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendPendingBetween( + sendPendingRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32701,7 +32713,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendPendingStartsWith( + sendPendingRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -32715,7 +32727,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendPendingEndsWith( + sendPendingRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -32729,7 +32741,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendPendingContains(String value, {bool caseSensitive = true}) { + sendPendingRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'sendPending', @@ -32740,7 +32752,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendPendingMatches(String pattern, {bool caseSensitive = true}) { + sendPendingRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'sendPending', @@ -32751,7 +32763,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendPendingIsEmpty() { + sendPendingRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'sendPending', @@ -32761,7 +32773,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - sendPendingIsNotEmpty() { + sendPendingRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'sendPending', @@ -32771,7 +32783,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackEqualTo( + stackRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -32785,7 +32797,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackGreaterThan( + stackRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -32801,7 +32813,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackLessThan( + stackRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -32817,7 +32829,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackBetween( + stackRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32837,7 +32849,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackStartsWith( + stackRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -32851,7 +32863,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackEndsWith( + stackRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -32865,7 +32877,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackContains(String value, {bool caseSensitive = true}) { + stackRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'stack', @@ -32876,7 +32888,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackMatches(String pattern, {bool caseSensitive = true}) { + stackRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'stack', @@ -32887,7 +32899,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIsEmpty() { + stackRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'stack', @@ -32897,7 +32909,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIsNotEmpty() { + stackRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'stack', @@ -32907,7 +32919,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIconEqualTo( + stackIconRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -32921,7 +32933,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIconGreaterThan( + stackIconRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -32937,7 +32949,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIconLessThan( + stackIconRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -32953,7 +32965,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIconBetween( + stackIconRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32973,7 +32985,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIconStartsWith( + stackIconRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -32987,7 +32999,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIconEndsWith( + stackIconRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -33001,7 +33013,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIconContains(String value, {bool caseSensitive = true}) { + stackIconRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'stackIcon', @@ -33012,7 +33024,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIconMatches(String pattern, {bool caseSensitive = true}) { + stackIconRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'stackIcon', @@ -33023,7 +33035,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIconIsEmpty() { + stackIconRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'stackIcon', @@ -33033,7 +33045,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - stackIconIsNotEmpty() { + stackIconRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'stackIcon', @@ -33043,7 +33055,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themePreviewEqualTo( + themePreviewRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -33057,7 +33069,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themePreviewGreaterThan( + themePreviewRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -33073,7 +33085,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themePreviewLessThan( + themePreviewRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -33089,7 +33101,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themePreviewBetween( + themePreviewRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -33109,7 +33121,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themePreviewStartsWith( + themePreviewRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -33123,7 +33135,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themePreviewEndsWith( + themePreviewRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -33137,7 +33149,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themePreviewContains(String value, {bool caseSensitive = true}) { + themePreviewRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'themePreview', @@ -33148,7 +33160,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themePreviewMatches(String pattern, {bool caseSensitive = true}) { + themePreviewRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'themePreview', @@ -33159,7 +33171,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themePreviewIsEmpty() { + themePreviewRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'themePreview', @@ -33169,7 +33181,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themePreviewIsNotEmpty() { + themePreviewRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'themePreview', @@ -33179,7 +33191,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themeSelectorEqualTo( + themeSelectorRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -33193,7 +33205,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themeSelectorGreaterThan( + themeSelectorRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -33209,7 +33221,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themeSelectorLessThan( + themeSelectorRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -33225,7 +33237,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themeSelectorBetween( + themeSelectorRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -33245,7 +33257,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themeSelectorStartsWith( + themeSelectorRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -33259,7 +33271,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themeSelectorEndsWith( + themeSelectorRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -33273,7 +33285,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themeSelectorContains(String value, {bool caseSensitive = true}) { + themeSelectorRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'themeSelector', @@ -33284,7 +33296,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themeSelectorMatches(String pattern, {bool caseSensitive = true}) { + themeSelectorRelativeMatches(String pattern, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'themeSelector', @@ -33295,7 +33308,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themeSelectorIsEmpty() { + themeSelectorRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'themeSelector', @@ -33305,7 +33318,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - themeSelectorIsNotEmpty() { + themeSelectorRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'themeSelector', @@ -33315,7 +33328,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeEqualTo( + txExchangeRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -33329,7 +33342,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeGreaterThan( + txExchangeRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -33345,7 +33358,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeLessThan( + txExchangeRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -33361,7 +33374,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeBetween( + txExchangeRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -33381,7 +33394,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeStartsWith( + txExchangeRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -33395,7 +33408,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeEndsWith( + txExchangeRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -33409,7 +33422,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeContains(String value, {bool caseSensitive = true}) { + txExchangeRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'txExchange', @@ -33420,7 +33433,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeMatches(String pattern, {bool caseSensitive = true}) { + txExchangeRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'txExchange', @@ -33431,7 +33444,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeIsEmpty() { + txExchangeRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'txExchange', @@ -33441,7 +33454,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeIsNotEmpty() { + txExchangeRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'txExchange', @@ -33451,7 +33464,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeFailedEqualTo( + txExchangeFailedRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -33465,7 +33478,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeFailedGreaterThan( + txExchangeFailedRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -33481,7 +33494,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeFailedLessThan( + txExchangeFailedRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -33497,7 +33510,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeFailedBetween( + txExchangeFailedRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -33517,7 +33530,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeFailedStartsWith( + txExchangeFailedRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -33531,7 +33544,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeFailedEndsWith( + txExchangeFailedRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -33545,7 +33558,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeFailedContains(String value, {bool caseSensitive = true}) { + txExchangeFailedRelativeContains(String value, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'txExchangeFailed', @@ -33556,7 +33570,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeFailedMatches(String pattern, {bool caseSensitive = true}) { + txExchangeFailedRelativeMatches(String pattern, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'txExchangeFailed', @@ -33567,7 +33582,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeFailedIsEmpty() { + txExchangeFailedRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'txExchangeFailed', @@ -33577,7 +33592,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangeFailedIsNotEmpty() { + txExchangeFailedRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'txExchangeFailed', @@ -33587,7 +33602,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangePendingEqualTo( + txExchangePendingRelativeEqualTo( String value, { bool caseSensitive = true, }) { @@ -33601,7 +33616,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangePendingGreaterThan( + txExchangePendingRelativeGreaterThan( String value, { bool include = false, bool caseSensitive = true, @@ -33617,7 +33632,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangePendingLessThan( + txExchangePendingRelativeLessThan( String value, { bool include = false, bool caseSensitive = true, @@ -33633,7 +33648,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangePendingBetween( + txExchangePendingRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -33653,7 +33668,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangePendingStartsWith( + txExchangePendingRelativeStartsWith( String value, { bool caseSensitive = true, }) { @@ -33667,7 +33682,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangePendingEndsWith( + txExchangePendingRelativeEndsWith( String value, { bool caseSensitive = true, }) { @@ -33681,7 +33696,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangePendingContains(String value, {bool caseSensitive = true}) { + txExchangePendingRelativeContains(String value, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.contains( property: r'txExchangePending', @@ -33692,7 +33708,8 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangePendingMatches(String pattern, {bool caseSensitive = true}) { + txExchangePendingRelativeMatches(String pattern, + {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.matches( property: r'txExchangePending', @@ -33703,7 +33720,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangePendingIsEmpty() { + txExchangePendingRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'txExchangePending', @@ -33713,7 +33730,7 @@ extension ThemeAssetsV3QueryFilter } QueryBuilder - txExchangePendingIsNotEmpty() { + txExchangePendingRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.greaterThan( property: r'txExchangePending', diff --git a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart index e8c7c711c..36c914fd8 100644 --- a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart +++ b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart @@ -8,6 +8,8 @@ * */ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:stackwallet/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart'; import 'package:stackwallet/themes/stack_colors.dart'; @@ -32,35 +34,37 @@ class CreateWalletButtonGroup extends StatelessWidget { crossAxisAlignment: isDesktop ? CrossAxisAlignment.center : CrossAxisAlignment.stretch, children: [ - ConstrainedBox( - constraints: BoxConstraints( - minHeight: isDesktop ? 70 : 0, - minWidth: isDesktop ? 480 : 0, - ), - child: TextButton( - style: Theme.of(context) - .extension()! - .getPrimaryEnabledButtonStyle(context), - onPressed: () { - Navigator.of(context).pushNamed( - NameYourWalletView.routeName, - arguments: Tuple2( - AddWalletType.New, - coin, - ), - ); - }, - child: Text( - "Create new wallet", - style: isDesktop - ? STextStyles.desktopButtonEnabled(context) - : STextStyles.button(context), + if (Platform.isAndroid || coin != Coin.wownero) + ConstrainedBox( + constraints: BoxConstraints( + minHeight: isDesktop ? 70 : 0, + minWidth: isDesktop ? 480 : 0, + ), + child: TextButton( + style: Theme.of(context) + .extension()! + .getPrimaryEnabledButtonStyle(context), + onPressed: () { + Navigator.of(context).pushNamed( + NameYourWalletView.routeName, + arguments: Tuple2( + AddWalletType.New, + coin, + ), + ); + }, + child: Text( + "Create new wallet", + style: isDesktop + ? STextStyles.desktopButtonEnabled(context) + : STextStyles.button(context), + ), ), ), - ), - SizedBox( - height: isDesktop ? 16 : 12, - ), + if (Platform.isAndroid || coin != Coin.wownero) + SizedBox( + height: isDesktop ? 16 : 12, + ), ConstrainedBox( constraints: BoxConstraints( minHeight: isDesktop ? 70 : 0, diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart index f162c4f73..87219d277 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart @@ -98,6 +98,7 @@ class _RestoreWalletViewState extends ConsumerState { final List _controllers = []; final List _inputStatuses = []; + final List _focusNodes = []; late final BarcodeScannerInterface scanner; @@ -151,6 +152,7 @@ class _RestoreWalletViewState extends ConsumerState { for (int i = 0; i < _seedWordCount; i++) { _controllers.add(TextEditingController()); _inputStatuses.add(FormInputStatus.empty); + _focusNodes.add(FocusNode()); } super.initState(); @@ -819,30 +821,43 @@ class _RestoreWalletViewState extends ConsumerState { i * 4 + j - 1 == 1 ? textSelectionControls : null, + focusNode: + _focusNodes[i * 4 + j - 1], onChanged: (value) { + final FormInputStatus + formInputStatus; + if (value.isEmpty) { - setState(() { - _inputStatuses[ - i * 4 + j - 1] = - FormInputStatus.empty; - }); + formInputStatus = + FormInputStatus.empty; } else if (_isValidMnemonicWord( value .trim() .toLowerCase())) { - setState(() { - _inputStatuses[ - i * 4 + j - 1] = - FormInputStatus.valid; - }); + formInputStatus = + FormInputStatus.valid; } else { - setState(() { - _inputStatuses[ - i * 4 + j - 1] = - FormInputStatus - .invalid; - }); + formInputStatus = + FormInputStatus.invalid; } + + if (formInputStatus == + FormInputStatus.valid) { + if (i * 4 + j < + _focusNodes.length) { + _focusNodes[i * 4 + j] + .requestFocus(); + } else if (i * 4 + j == + _focusNodes.length) { + _focusNodes[i * 4 + j - 1] + .unfocus(); + } + } + setState(() { + _inputStatuses[i * 4 + + j - + 1] = formInputStatus; + }); }, controller: _controllers[i * 4 + j - 1], @@ -914,26 +929,45 @@ class _RestoreWalletViewState extends ConsumerState { selectionControls: i == 1 ? textSelectionControls : null, + focusNode: _focusNodes[i], onChanged: (value) { + final FormInputStatus + formInputStatus; + if (value.isEmpty) { - setState(() { - _inputStatuses[i] = - FormInputStatus.empty; - }); + formInputStatus = + FormInputStatus.empty; } else if (_isValidMnemonicWord( value .trim() .toLowerCase())) { - setState(() { - _inputStatuses[i] = - FormInputStatus.valid; - }); + formInputStatus = + FormInputStatus.valid; } else { - setState(() { - _inputStatuses[i] = + formInputStatus = + FormInputStatus.invalid; + } + + if (formInputStatus == FormInputStatus - .invalid; - }); + .valid && + (i - 1) < + _focusNodes.length) { + Focus.of(context) + .requestFocus( + _focusNodes[i]); + } + + if (formInputStatus == + FormInputStatus.valid) { + if (i + 1 < + _focusNodes.length) { + _focusNodes[i + 1] + .requestFocus(); + } else if (i + 1 == + _focusNodes.length) { + _focusNodes[i].unfocus(); + } } }, controller: _controllers[i], @@ -1034,24 +1068,34 @@ class _RestoreWalletViewState extends ConsumerState { AutovalidateMode.onUserInteraction, selectionControls: i == 1 ? textSelectionControls : null, + focusNode: _focusNodes[i - 1], onChanged: (value) { + final FormInputStatus formInputStatus; + if (value.isEmpty) { - setState(() { - _inputStatuses[i - 1] = - FormInputStatus.empty; - }); + formInputStatus = + FormInputStatus.empty; } else if (_isValidMnemonicWord( value.trim().toLowerCase())) { - setState(() { - _inputStatuses[i - 1] = - FormInputStatus.valid; - }); + formInputStatus = + FormInputStatus.valid; } else { - setState(() { - _inputStatuses[i - 1] = - FormInputStatus.invalid; - }); + formInputStatus = + FormInputStatus.invalid; } + + if (formInputStatus == + FormInputStatus.valid) { + if (i < _focusNodes.length) { + _focusNodes[i].requestFocus(); + } else if (i == _focusNodes.length) { + _focusNodes[i - 1].unfocus(); + } + } + setState(() { + _inputStatuses[i - 1] = + formInputStatus; + }); }, controller: _controllers[i - 1], style: diff --git a/lib/pages/address_book_views/address_book_view.dart b/lib/pages/address_book_views/address_book_view.dart index 037a9772b..d50eaee70 100644 --- a/lib/pages/address_book_views/address_book_view.dart +++ b/lib/pages/address_book_views/address_book_view.dart @@ -302,7 +302,7 @@ class _AddressBookViewState extends ConsumerState { child: Column( children: [ ...contacts - .where((element) => element.addresses + .where((element) => element.addressesSorted .where((e) => ref.watch(addressBookFilterProvider .select((value) => value.coins.contains(e.coin)))) .isNotEmpty) @@ -350,7 +350,7 @@ class _AddressBookViewState extends ConsumerState { child: Column( children: [ ...contacts - .where((element) => element.addresses + .where((element) => element.addressesSorted .where((e) => ref.watch( addressBookFilterProvider.select((value) => value.coins.contains(e.coin)))) diff --git a/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart b/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart index 4916ec69d..11d6566a2 100644 --- a/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart +++ b/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart @@ -211,7 +211,8 @@ class _AddNewContactAddressViewState const Duration(milliseconds: 75), ); } - List entries = contact.addresses; + List entries = + contact.addresses.toList(); entries.add(ref .read(addressEntryDataProvider(0)) diff --git a/lib/pages/address_book_views/subviews/contact_details_view.dart b/lib/pages/address_book_views/subviews/contact_details_view.dart index ce543e04f..01e8ef3c3 100644 --- a/lib/pages/address_book_views/subviews/contact_details_view.dart +++ b/lib/pages/address_book_views/subviews/contact_details_view.dart @@ -341,7 +341,7 @@ class _ContactDetailsViewState extends ConsumerState { padding: const EdgeInsets.all(0), child: Column( children: [ - ..._contact.addresses.map( + ..._contact.addressesSorted.map( (e) => Padding( padding: const EdgeInsets.all(12), child: Row( diff --git a/lib/pages/address_book_views/subviews/contact_popup.dart b/lib/pages/address_book_views/subviews/contact_popup.dart index a82eca283..4315ef7e1 100644 --- a/lib/pages/address_book_views/subviews/contact_popup.dart +++ b/lib/pages/address_book_views/subviews/contact_popup.dart @@ -63,7 +63,7 @@ class ContactPopUp extends ConsumerWidget { bool isExchangeFlow = ref.watch(exchangeFlowIsActiveStateProvider.state).state; - final addresses = contact.addresses.where((e) { + final addresses = contact.addressesSorted.where((e) { if (hasActiveWallet && !isExchangeFlow) { return e.coin == active[0].coin; } else { diff --git a/lib/pages/buy_view/buy_order_details.dart b/lib/pages/buy_view/buy_order_details.dart index 250cba77b..04a556850 100644 --- a/lib/pages/buy_view/buy_order_details.dart +++ b/lib/pages/buy_view/buy_order_details.dart @@ -9,9 +9,11 @@ */ import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/models/buy/response_objects/order.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -21,7 +23,7 @@ import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; -class BuyOrderDetailsView extends StatefulWidget { +class BuyOrderDetailsView extends ConsumerStatefulWidget { const BuyOrderDetailsView({ Key? key, required this.order, @@ -32,10 +34,11 @@ class BuyOrderDetailsView extends StatefulWidget { static const String routeName = "/buyOrderDetails"; @override - State createState() => _BuyOrderDetailsViewState(); + ConsumerState createState() => + _BuyOrderDetailsViewState(); } -class _BuyOrderDetailsViewState extends State { +class _BuyOrderDetailsViewState extends ConsumerState { final isDesktop = Util.isDesktop; @override @@ -245,7 +248,9 @@ class _BuyOrderDetailsViewState extends State { width: 64, height: 32, child: SvgPicture.asset( - Assets.buy.simplexLogo(context), + Assets.buy.simplexLogo( + ref.watch(themeProvider).brightness, + ), ), ), ], diff --git a/lib/pages/buy_view/buy_quote_preview.dart b/lib/pages/buy_view/buy_quote_preview.dart index 3f4f96006..66b9af812 100644 --- a/lib/pages/buy_view/buy_quote_preview.dart +++ b/lib/pages/buy_view/buy_quote_preview.dart @@ -11,11 +11,13 @@ import 'dart:async'; import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:intl/intl.dart'; import 'package:stackwallet/models/buy/response_objects/quote.dart'; import 'package:stackwallet/pages/buy_view/sub_widgets/buy_warning_popup.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -25,7 +27,7 @@ import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; -class BuyQuotePreviewView extends StatefulWidget { +class BuyQuotePreviewView extends ConsumerStatefulWidget { const BuyQuotePreviewView({ Key? key, required this.quote, @@ -36,10 +38,11 @@ class BuyQuotePreviewView extends StatefulWidget { static const String routeName = "/buyQuotePreview"; @override - State createState() => _BuyQuotePreviewViewState(); + ConsumerState createState() => + _BuyQuotePreviewViewState(); } -class _BuyQuotePreviewViewState extends State { +class _BuyQuotePreviewViewState extends ConsumerState { final isDesktop = Util.isDesktop; Future _buyWarning() async { @@ -222,7 +225,9 @@ class _BuyQuotePreviewViewState extends State { width: 64, height: 32, child: SvgPicture.asset( - Assets.buy.simplexLogo(context), + Assets.buy.simplexLogo( + ref.watch(themeProvider).brightness, + ), ), ), ], diff --git a/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart b/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart index f5d61e3f4..fa651e7df 100644 --- a/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart +++ b/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart @@ -11,6 +11,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/models/buy/response_objects/order.dart'; import 'package:stackwallet/models/buy/response_objects/quote.dart'; @@ -18,6 +19,7 @@ import 'package:stackwallet/pages/buy_view/buy_order_details.dart'; import 'package:stackwallet/services/buy/buy_response.dart'; import 'package:stackwallet/services/buy/simplex/simplex_api.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -28,7 +30,7 @@ import 'package:stackwallet/widgets/desktop/secondary_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; -class BuyWarningPopup extends StatefulWidget { +class BuyWarningPopup extends ConsumerStatefulWidget { const BuyWarningPopup({ Key? key, required this.quote, @@ -37,10 +39,10 @@ class BuyWarningPopup extends StatefulWidget { final SimplexQuote quote; final SimplexOrder? order; @override - State createState() => _BuyWarningPopupState(); + ConsumerState createState() => _BuyWarningPopupState(); } -class _BuyWarningPopupState extends State { +class _BuyWarningPopupState extends ConsumerState { late final bool isDesktop; SimplexOrder? order; @@ -236,7 +238,9 @@ class _BuyWarningPopupState extends State { width: 64, height: 32, child: SvgPicture.asset( - Assets.buy.simplexLogo(context), + Assets.buy.simplexLogo( + ref.watch(themeProvider).brightness, + ), ), ), ], @@ -291,7 +295,9 @@ class _BuyWarningPopupState extends State { width: 64, height: 32, child: SvgPicture.asset( - Assets.buy.simplexLogo(context), + Assets.buy.simplexLogo( + ref.watch(themeProvider).brightness, + ), ), ), ); diff --git a/lib/pages/exchange_view/exchange_form.dart b/lib/pages/exchange_view/exchange_form.dart index e65242fbd..a15e13843 100644 --- a/lib/pages/exchange_view/exchange_form.dart +++ b/lib/pages/exchange_view/exchange_form.dart @@ -35,6 +35,7 @@ import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart import 'package:stackwallet/services/exchange/majestic_bank/majestic_bank_exchange.dart'; import 'package:stackwallet/services/exchange/trocador/trocador_exchange.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -160,26 +161,15 @@ class _ExchangeFormState extends ConsumerState { if (value == null) { return null; } - try { - // wtf Dart????? - // This turns "99999999999999999999" into 100000000000000000000.0 - // final numFromLocalised = NumberFormat.decimalPattern( - // ref.read(localeServiceChangeNotifierProvider).locale) - // .parse(value); - // return Decimal.tryParse(numFromLocalised.toString()); - try { - return Decimal.parse(value); - } catch (_) { - try { - return Decimal.parse(value.replaceAll(",", ".")); - } catch (_) { - rethrow; - } - } - } catch (_) { - return null; - } + return AmountUnit.normal + .tryParse( + value, + locale: ref.read(localeServiceChangeNotifierProvider).locale, + coin: Coin.bitcoin, // dummy value (not used due to override) + overrideWithDecimalPlacesFromString: true, + ) + ?.decimal; } Future _getAggregateCurrency(Currency currency) async { @@ -809,6 +799,14 @@ class _ExchangeFormState extends ConsumerState { // if (_swapLock) { _sendController.text = ref.read(efSendAmountStringProvider); // } + + if (_sendFocusNode.hasFocus) { + _sendController.selection = TextSelection.fromPosition( + TextPosition( + offset: _sendController.text.length, + ), + ); + } } }); ref.listen(efSendAmountStringProvider, (previous, String next) { @@ -820,11 +818,19 @@ class _ExchangeFormState extends ConsumerState { ? "-" : ref.read(efReceiveAmountStringProvider); // } + + if (_receiveFocusNode.hasFocus) { + _receiveController.selection = TextSelection.fromPosition( + TextPosition( + offset: _receiveController.text.length, + ), + ); + } } }); ref.listen(efEstimateProvider.notifier, (previous, next) { - final estimate = (next as StateController).state; + final estimate = (next).state; if (ref.read(efReversedProvider)) { updateSend(estimate); } else { diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index 063f2b2cd..d77e0e244 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -22,6 +22,7 @@ import 'package:stackwallet/pages/receive_view/generate_receiving_uri_qr_code_vi import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; @@ -337,7 +338,11 @@ class _ReceiveViewState extends ConsumerState { child: Column( children: [ QrImageView( - data: "${coin.uriScheme}:$receivingAddress", + data: AddressUtils.buildUriString( + coin, + receivingAddress, + {}, + ), size: MediaQuery.of(context).size.width / 2, foregroundColor: Theme.of(context) .extension()! diff --git a/lib/pages/send_view/confirm_transaction_view.dart b/lib/pages/send_view/confirm_transaction_view.dart index e50d15193..a1fc66f21 100644 --- a/lib/pages/send_view/confirm_transaction_view.dart +++ b/lib/pages/send_view/confirm_transaction_view.dart @@ -493,27 +493,54 @@ class _ConfirmTransactionViewState ], ), ), - const SizedBox( - height: 12, - ), - RoundedWhiteContainer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Text( - "Note", - style: STextStyles.smallMed12(context), - ), - const SizedBox( - height: 4, - ), - Text( - transactionInfo["note"] as String, - style: STextStyles.itemSubtitle12(context), - ), - ], + if (coin == Coin.epicCash && + (transactionInfo["onChainNote"] as String).isNotEmpty) + const SizedBox( + height: 12, + ), + if (coin == Coin.epicCash && + (transactionInfo["onChainNote"] as String).isNotEmpty) + RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + "On chain note", + style: STextStyles.smallMed12(context), + ), + const SizedBox( + height: 4, + ), + Text( + transactionInfo["onChainNote"] as String, + style: STextStyles.itemSubtitle12(context), + ), + ], + ), + ), + if ((transactionInfo["note"] as String).isNotEmpty) + const SizedBox( + height: 12, + ), + if ((transactionInfo["note"] as String).isNotEmpty) + RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + (coin == Coin.epicCash) ? "Local Note" : "Note", + style: STextStyles.smallMed12(context), + ), + const SizedBox( + height: 4, + ), + Text( + transactionInfo["note"] as String, + style: STextStyles.itemSubtitle12(context), + ), + ], + ), ), - ), ], ), if (isDesktop) diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 0f503588c..c3e66e758 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -101,12 +101,14 @@ class _SendViewState extends ConsumerState { late TextEditingController cryptoAmountController; late TextEditingController baseAmountController; late TextEditingController noteController; + late TextEditingController onChainNoteController; late TextEditingController feeController; late final SendViewAutoFillData? _data; final _addressFocusNode = FocusNode(); final _noteFocusNode = FocusNode(); + final _onChainNoteFocusNode = FocusNode(); final _cryptoFocus = FocusNode(); final _baseFocus = FocusNode(); @@ -546,6 +548,7 @@ class _SendViewState extends ConsumerState { // pop building dialog Navigator.of(context).pop(); txData["note"] = noteController.text; + txData["onChainNote"] = onChainNoteController.text; if (isPaynymSend) { txData["paynymAccountLite"] = widget.accountLite!; } else { @@ -624,6 +627,7 @@ class _SendViewState extends ConsumerState { cryptoAmountController = TextEditingController(); baseAmountController = TextEditingController(); noteController = TextEditingController(); + onChainNoteController = TextEditingController(); feeController = TextEditingController(); onCryptoAmountChanged = _cryptoAmountChanged; @@ -698,9 +702,11 @@ class _SendViewState extends ConsumerState { cryptoAmountController.dispose(); baseAmountController.dispose(); noteController.dispose(); + onChainNoteController.dispose(); feeController.dispose(); _noteFocusNode.dispose(); + _onChainNoteFocusNode.dispose(); _addressFocusNode.dispose(); _cryptoFocus.dispose(); _baseFocus.dispose(); @@ -1794,8 +1800,64 @@ class _SendViewState extends ConsumerState { const SizedBox( height: 12, ), + if (coin == Coin.epicCash) + Text( + "On chain Note (optional)", + style: STextStyles.smallMed12(context), + textAlign: TextAlign.left, + ), + if (coin == Coin.epicCash) + const SizedBox( + height: 8, + ), + if (coin == Coin.epicCash) + ClipRRect( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + child: TextField( + autocorrect: Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop ? false : true, + maxLength: 256, + controller: onChainNoteController, + focusNode: _onChainNoteFocusNode, + style: STextStyles.field(context), + onChanged: (_) => setState(() {}), + decoration: standardInputDecoration( + "Type something...", + _onChainNoteFocusNode, + context, + ).copyWith( + suffixIcon: onChainNoteController.text.isNotEmpty + ? Padding( + padding: + const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + onChainNoteController.text = ""; + }); + }, + ), + ], + ), + ), + ) + : null, + ), + ), + ), + if (coin == Coin.epicCash) + const SizedBox( + height: 12, + ), Text( - "Note (optional)", + (coin == Coin.epicCash) ? "Local Note (optional)" + : "Note (optional)", style: STextStyles.smallMed12(context), textAlign: TextAlign.left, ), @@ -2065,6 +2127,7 @@ class _SendViewState extends ConsumerState { top: 16, ), child: FeeSlider( + coin: coin, onSatVByteChanged: (rate) { customFeeRate = rate; }, diff --git a/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/stack_theme_card.dart b/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/stack_theme_card.dart index af83e4db0..0c45a68f7 100644 --- a/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/stack_theme_card.dart +++ b/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/stack_theme_card.dart @@ -126,7 +126,7 @@ class _StackThemeCardState extends ConsumerState { } Future getThemeDirectorySize() async { - final themesDir = await StackFileSystem.applicationThemesDirectory(); + final themesDir = StackFileSystem.themesDir!; final themeDir = Directory("${themesDir.path}/${widget.data.id}"); int bytes = 0; if (await themeDir.exists()) { diff --git a/lib/pages/settings_views/global_settings_view/delete_account_view.dart b/lib/pages/settings_views/global_settings_view/delete_account_view.dart index 2b794f351..f6acc0ac8 100644 --- a/lib/pages/settings_views/global_settings_view/delete_account_view.dart +++ b/lib/pages/settings_views/global_settings_view/delete_account_view.dart @@ -9,9 +9,9 @@ */ import 'package:flutter/material.dart'; +import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/pages/intro_view.dart'; import 'package:stackwallet/themes/stack_colors.dart'; -import 'package:stackwallet/utilities/delete_everything.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; @@ -36,7 +36,7 @@ class _DeleteAccountViewState extends State { Future onConfirmDeleteAccount() async { // TODO delete everything then pop to intro view - await showDialog( + await showDialog( barrierDismissible: true, context: context, builder: (_) => StackDialog( @@ -61,12 +61,14 @@ class _DeleteAccountViewState extends State { .extension()! .getPrimaryEnabledButtonStyle(context), onPressed: () async { - await deleteEverything(); + await DB.instance.deleteEverything(); - await Navigator.of(context).pushNamedAndRemoveUntil( - IntroView.routeName, - (route) => false, - ); + if (mounted) { + await Navigator.of(context).pushNamedAndRemoveUntil( + IntroView.routeName, + (route) => false, + ); + } }, child: Text( "Delete", @@ -82,7 +84,7 @@ class _DeleteAccountViewState extends State { return MasterScaffold( isDesktop: isDesktop, appBar: isDesktop - ? DesktopAppBar(isCompactHeight: true) + ? const DesktopAppBar(isCompactHeight: true) : AppBar( leading: AppBarBackButton( onPressed: () async { diff --git a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart index cba8f5e5f..2b1ba62c4 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -358,6 +358,8 @@ class _TransactionDetailsViewState final currentHeight = ref.watch(walletsChangeNotifierProvider .select((value) => value.getManager(walletId).currentHeight)); + print("THIS TRANSACTION IS $_transaction"); + return ConditionalParent( condition: !isDesktop, builder: (child) => Background( @@ -471,7 +473,9 @@ class _TransactionDetailsViewState ), SelectableText( _transaction.isCancelled - ? "Cancelled" + ? coin == Coin.ethereum + ? "Failed" + : "Cancelled" : whatIsIt( _transaction, currentHeight, @@ -582,7 +586,9 @@ class _TransactionDetailsViewState // child: SelectableText( _transaction.isCancelled - ? "Cancelled" + ? coin == Coin.ethereum + ? "Failed" + : "Cancelled" : whatIsIt( _transaction, currentHeight, @@ -774,12 +780,69 @@ class _TransactionDetailsViewState ], ), ), + if (coin == Coin.epicCash) + isDesktop + ? const _Divider() + : const SizedBox( + height: 12, + ), + if (coin == Coin.epicCash) + RoundedWhiteContainer( + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + "On chain note", + style: isDesktop + ? STextStyles + .desktopTextExtraExtraSmall( + context) + : STextStyles.itemSubtitle( + context), + ), + const SizedBox( + height: 8, + ), + SelectableText( + _transaction.otherData ?? "", + style: isDesktop + ? STextStyles + .desktopTextExtraExtraSmall( + context) + .copyWith( + color: Theme.of(context) + .extension< + StackColors>()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context), + ), + ], + ), + ), + if (isDesktop) + IconCopyButton( + data: _transaction.address.value!.value, + ), + ], + ), + ), isDesktop ? const _Divider() : const SizedBox( height: 12, ), - RoundedWhiteContainer( padding: isDesktop ? const EdgeInsets.all(16) @@ -792,7 +855,9 @@ class _TransactionDetailsViewState MainAxisAlignment.spaceBetween, children: [ Text( - "Note", + (coin == Coin.epicCash) + ? "Local Note" + : "Note ", style: isDesktop ? STextStyles .desktopTextExtraExtraSmall( @@ -861,7 +926,9 @@ class _TransactionDetailsViewState notesServiceChangeNotifierProvider( walletId) .select((value) => value.getNoteFor( - txid: _transaction.txid))), + txid: (coin == Coin.epicCash) + ? _transaction.slateId! + : _transaction.txid))), builder: (builderContext, AsyncSnapshot snapshot) { if (snapshot.connectionState == diff --git a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart index cb570be90..fc626f290 100644 --- a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart +++ b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart @@ -8,6 +8,8 @@ * */ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -43,8 +45,10 @@ class DesktopAddressCard extends ConsumerWidget { return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SvgPicture.asset( - ref.watch(coinIconProvider(entry.coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(entry.coin)), + ), height: 32, width: 32, ), diff --git a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart index 267a7c2b9..e1825a3a6 100644 --- a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart +++ b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart @@ -53,15 +53,6 @@ class DesktopContactDetails extends ConsumerStatefulWidget { class _DesktopContactDetailsState extends ConsumerState { List> _cachedTransactions = []; - bool _contactHasAddress(String address, ContactEntry contact) { - for (final entry in contact.addresses) { - if (entry.address == address) { - return true; - } - } - return false; - } - Future>> _filteredTransactionsByContact( List managers, ) async { @@ -259,7 +250,9 @@ class _DesktopContactDetailsState extends ConsumerState { child: Column( mainAxisSize: MainAxisSize.min, children: [ - for (int i = 0; i < contact.addresses.length; i++) + for (int i = 0; + i < contact.addressesSorted.length; + i++) Column( mainAxisSize: MainAxisSize.min, children: [ @@ -273,7 +266,7 @@ class _DesktopContactDetailsState extends ConsumerState { Padding( padding: const EdgeInsets.all(18), child: DesktopAddressCard( - entry: contact.addresses[i], + entry: contact.addressesSorted[i], contactId: contact.customId, ), ), diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/address_book_address_chooser.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/address_book_address_chooser.dart index 13c501f70..ee10acb54 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/address_book_address_chooser.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/address_book_address_chooser.dart @@ -69,8 +69,8 @@ class _AddressBookAddressChooserState extends State { List filter(List contacts, String searchTerm) { if (widget.coin != null) { - contacts.removeWhere( - (e) => e.addresses.where((a) => a.coin == widget.coin!).isEmpty); + contacts.removeWhere((e) => + e.addressesSorted.where((a) => a.coin == widget.coin!).isEmpty); } contacts.retainWhere((e) => _matches(searchTerm, e)); diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart index 4d05f73a4..7d0be498e 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart @@ -78,7 +78,7 @@ class _ContactListItemState extends ConsumerState { mainAxisSize: MainAxisSize.min, children: [ // filter addresses by coin is provided before building address list - ...contact.addresses + ...contact.addressesSorted .where((e) => filterByCoin != null ? e.coin == filterByCoin! : true) .map( diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart index 7b972eab3..292517699 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart @@ -21,6 +21,7 @@ import 'package:stackwallet/pages/token_view/token_view.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; @@ -236,7 +237,11 @@ class _DesktopReceiveState extends ConsumerState { ), Center( child: QrImageView( - data: "${coin.uriScheme}:$receivingAddress", + data: AddressUtils.buildUriString( + coin, + receivingAddress, + {}, + ), size: 200, foregroundColor: Theme.of(context).extension()!.accentColorDark, diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart index 76ac3fef9..0488358a7 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart @@ -9,7 +9,6 @@ */ import 'dart:async'; -import 'dart:math'; import 'package:bip47/bip47.dart'; import 'package:cw_core/monero_transaction_priority.dart'; @@ -462,27 +461,11 @@ class _DesktopSendState extends ConsumerState { void _cryptoAmountChanged() async { if (!_cryptoAmountChangeLock) { - String cryptoAmount = cryptoAmountController.text; - if (cryptoAmount.isNotEmpty && - cryptoAmount != "." && - cryptoAmount != ",") { - if (cryptoAmount.startsWith("~")) { - cryptoAmount = cryptoAmount.substring(1); - } - if (cryptoAmount.contains(" ")) { - cryptoAmount = cryptoAmount.split(" ").first; - } - - // ensure we don't shift past minimum atomic value - final shift = min(ref.read(pAmountUnit(coin)).shift, coin.decimals); - - _amountToSend = cryptoAmount.contains(",") - ? Decimal.parse(cryptoAmount.replaceFirst(",", ".")) - .shift(0 - shift) - .toAmount(fractionDigits: coin.decimals) - : Decimal.parse(cryptoAmount) - .shift(0 - shift) - .toAmount(fractionDigits: coin.decimals); + final cryptoAmount = ref.read(pAmountFormatter(coin)).tryParse( + cryptoAmountController.text, + ); + if (cryptoAmount != null) { + _amountToSend = cryptoAmount; if (_cachedAmountToSend != null && _cachedAmountToSend == _amountToSend) { return; @@ -677,15 +660,12 @@ class _DesktopSendState extends ConsumerState { } void fiatTextFieldOnChanged(String baseAmountString) { - if (baseAmountString.isNotEmpty && - baseAmountString != "." && - baseAmountString != ",") { - final baseAmount = baseAmountString.contains(",") - ? Decimal.parse(baseAmountString.replaceFirst(",", ".")) - .toAmount(fractionDigits: 2) - : Decimal.parse(baseAmountString).toAmount(fractionDigits: 2); - - var _price = + final baseAmount = Amount.tryParseFiatString( + baseAmountString, + locale: ref.read(localeServiceChangeNotifierProvider).locale, + ); + if (baseAmount != null) { + final _price = ref.read(priceAnd24hChangeNotifierProvider).getPrice(coin).item1; if (_price == Decimal.zero) { @@ -1389,7 +1369,10 @@ class _DesktopSendState extends ConsumerState { ), if (!([Coin.nano, Coin.banano, Coin.epicCash].contains(coin))) ConditionalParent( - condition: coin.isElectrumXCoin, + condition: coin.isElectrumXCoin && + !(((coin == Coin.firo || coin == Coin.firoTestNet) && + ref.read(publicPrivateBalanceStateProvider.state).state == + "Private")), builder: (child) => Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -1441,72 +1424,117 @@ class _DesktopSendState extends ConsumerState { ), if (!([Coin.nano, Coin.banano, Coin.epicCash].contains(coin))) if (!isCustomFee) - (feeSelectionResult?.$2 == null) - ? FutureBuilder( - future: ref.watch( - walletsChangeNotifierProvider.select( - (value) => value.getManager(walletId).fees, + Padding( + padding: const EdgeInsets.all(10), + child: (feeSelectionResult?.$2 == null) + ? FutureBuilder( + future: ref.watch( + walletsChangeNotifierProvider.select( + (value) => value.getManager(walletId).fees, + ), ), - ), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.done && - snapshot.hasData) { - return DesktopFeeItem( - feeObject: snapshot.data, - feeRateType: FeeRateType.average, - walletId: walletId, - feeFor: ({ - required Amount amount, - required FeeRateType feeRateType, - required int feeRate, - required Coin coin, - }) async { - if (ref - .read(feeSheetSessionCacheProvider) - .average[amount] == - null) { - final manager = ref - .read(walletsChangeNotifierProvider) - .getManager(walletId); + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + return DesktopFeeItem( + feeObject: snapshot.data, + feeRateType: FeeRateType.average, + walletId: walletId, + isButton: false, + feeFor: ({ + required Amount amount, + required FeeRateType feeRateType, + required int feeRate, + required Coin coin, + }) async { + if (ref + .read(feeSheetSessionCacheProvider) + .average[amount] == + null) { + final manager = ref + .read(walletsChangeNotifierProvider) + .getManager(walletId); - if (coin == Coin.monero || coin == Coin.wownero) { - final fee = await manager.estimateFeeFor(amount, - MoneroTransactionPriority.regular.raw!); - ref - .read(feeSheetSessionCacheProvider) - .average[amount] = fee; - } else if ((coin == Coin.firo || - coin == Coin.firoTestNet) && + if (coin == Coin.monero || + coin == Coin.wownero) { + final fee = await manager.estimateFeeFor( + amount, + MoneroTransactionPriority.regular.raw!); ref - .read( - publicPrivateBalanceStateProvider - .state) - .state != - "Private") { - ref - .read(feeSheetSessionCacheProvider) - .average[amount] = - await (manager.wallet as FiroWallet) - .estimateFeeForPublic(amount, feeRate); - } else { - ref - .read(feeSheetSessionCacheProvider) - .average[amount] = - await manager.estimateFeeFor( - amount, feeRate); + .read(feeSheetSessionCacheProvider) + .average[amount] = fee; + } else if ((coin == Coin.firo || + coin == Coin.firoTestNet) && + ref + .read( + publicPrivateBalanceStateProvider + .state) + .state != + "Private") { + ref + .read(feeSheetSessionCacheProvider) + .average[amount] = await (manager.wallet + as FiroWallet) + .estimateFeeForPublic(amount, feeRate); + } else { + ref + .read(feeSheetSessionCacheProvider) + .average[amount] = + await manager.estimateFeeFor( + amount, feeRate); + } } - } - return ref - .read(feeSheetSessionCacheProvider) - .average[amount]!; - }, - isSelected: true, - ); - } else { - return Row( + return ref + .read(feeSheetSessionCacheProvider) + .average[amount]!; + }, + isSelected: true, + ); + } else { + return Row( + children: [ + AnimatedText( + stringsToLoopThrough: stringsToLoopThrough, + style: STextStyles.desktopTextExtraExtraSmall( + context) + .copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveText, + ), + ), + ], + ); + } + }, + ) + : (coin == Coin.firo || coin == Coin.firoTestNet) && + ref + .watch( + publicPrivateBalanceStateProvider.state) + .state == + "Private" + ? Text( + "~${ref.watch(pAmountFormatter(coin)).format( + Amount( + rawValue: BigInt.parse("3794"), + fractionDigits: coin.decimals, + ), + indicatePrecisionLoss: false, + )}", + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveText, + ), + textAlign: TextAlign.left, + ) + : Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AnimatedText( - stringsToLoopThrough: stringsToLoopThrough, + Text( + feeSelectionResult?.$2 ?? "", style: STextStyles.desktopTextExtraExtraSmall( context) .copyWith( @@ -1514,36 +1542,21 @@ class _DesktopSendState extends ConsumerState { .extension()! .textFieldActiveText, ), + textAlign: TextAlign.left, + ), + Text( + feeSelectionResult?.$3 ?? "", + style: STextStyles.desktopTextExtraExtraSmall( + context) + .copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, + ), ), ], - ); - } - }, - ) - : Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - feeSelectionResult?.$2 ?? "", - style: STextStyles.desktopTextExtraExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, ), - textAlign: TextAlign.left, - ), - Text( - feeSelectionResult?.$3 ?? "", - style: STextStyles.desktopTextExtraExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, - ), - ), - ], - ), + ), if (isCustomFee) Padding( padding: const EdgeInsets.only( @@ -1551,6 +1564,7 @@ class _DesktopSendState extends ConsumerState { top: 16, ), child: FeeSlider( + coin: coin, onSatVByteChanged: (rate) { customFeeRate = rate; }, diff --git a/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart b/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart index 4bed14229..db945a4c3 100644 --- a/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart +++ b/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart @@ -15,7 +15,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:hive_flutter/hive_flutter.dart'; import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart'; @@ -213,8 +212,8 @@ class _ForgottenPassphraseRestoreFromSWBState await (ref.read(secureStoreProvider).store as DesktopSecureStore) .close(); ref.refresh(secureStoreProvider); + await ref.read(storageCryptoHandlerProvider).deleteBox(); ref.refresh(storageCryptoHandlerProvider); - await Hive.deleteBoxFromDisk(DB.boxNameDesktopData); await DB.instance.init(); if (mounted) { Navigator.of(context) diff --git a/lib/pages_desktop_specific/settings/desktop_settings_view.dart b/lib/pages_desktop_specific/settings/desktop_settings_view.dart index 596337925..2a8c180f9 100644 --- a/lib/pages_desktop_specific/settings/desktop_settings_view.dart +++ b/lib/pages_desktop_specific/settings/desktop_settings_view.dart @@ -83,10 +83,10 @@ class _DesktopSettingsViewState extends ConsumerState { Widget build(BuildContext context) { return DesktopScaffold( background: Theme.of(context).extension()!.background, - appBar: DesktopAppBar( + appBar: const DesktopAppBar( isCompactHeight: true, leading: Row( - children: const [ + children: [ SizedBox( width: 24, height: 24, @@ -97,7 +97,10 @@ class _DesktopSettingsViewState extends ConsumerState { ), body: Row( children: [ - const SettingsMenu(), + const Padding( + padding: EdgeInsets.all(15.0), + child: SettingsMenu(), + ), Expanded( child: contentViews[ ref.watch(selectedSettingsMenuItemStateProvider.state).state], diff --git a/lib/pages_desktop_specific/settings/settings_menu.dart b/lib/pages_desktop_specific/settings/settings_menu.dart index f21398000..4f3175a72 100644 --- a/lib/pages_desktop_specific/settings/settings_menu.dart +++ b/lib/pages_desktop_specific/settings/settings_menu.dart @@ -45,10 +45,10 @@ class _SettingsMenuState extends ConsumerState { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: const EdgeInsets.only(left: 15), + SizedBox( + width: 250, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ for (int i = 0; i < labels.length; i++) Column( @@ -83,157 +83,7 @@ class _SettingsMenuState extends ConsumerState { .state = newValue, ), ], - ) - - // SettingsMenuItem( - // icon: SvgPicture.asset( - // Assets.svg.polygon, - // width: 11, - // height: 11, - // color: selectedMenuItem == 0 - // ? Theme.of(context) - // .extension()! - // .accentColorBlue - // : Colors.transparent, - // ), - // label: "Backup and restore", - // value: 0, - // group: selectedMenuItem, - // onChanged: updateSelectedMenuItem, - // ), - // const SizedBox( - // height: 2, - // ), - // SettingsMenuItem( - // icon: SvgPicture.asset( - // Assets.svg.polygon, - // width: 11, - // height: 11, - // color: selectedMenuItem == 1 - // ? Theme.of(context) - // .extension()! - // .accentColorBlue - // : Colors.transparent, - // ), - // label: "Security", - // value: 1, - // group: selectedMenuItem, - // onChanged: updateSelectedMenuItem, - // ), - // const SizedBox( - // height: 2, - // ), - // SettingsMenuItem( - // icon: SvgPicture.asset( - // Assets.svg.polygon, - // width: 11, - // height: 11, - // color: selectedMenuItem == 2 - // ? Theme.of(context) - // .extension()! - // .accentColorBlue - // : Colors.transparent, - // ), - // label: "Currency", - // value: 2, - // group: selectedMenuItem, - // onChanged: updateSelectedMenuItem, - // ), - // const SizedBox( - // height: 2, - // ), - // SettingsMenuItem( - // icon: SvgPicture.asset( - // Assets.svg.polygon, - // width: 11, - // height: 11, - // color: selectedMenuItem == 3 - // ? Theme.of(context) - // .extension()! - // .accentColorBlue - // : Colors.transparent, - // ), - // label: "Language", - // value: 3, - // group: selectedMenuItem, - // onChanged: updateSelectedMenuItem, - // ), - // const SizedBox( - // height: 2, - // ), - // SettingsMenuItem( - // icon: SvgPicture.asset( - // Assets.svg.polygon, - // width: 11, - // height: 11, - // color: selectedMenuItem == 4 - // ? Theme.of(context) - // .extension()! - // .accentColorBlue - // : Colors.transparent, - // ), - // label: "Nodes", - // value: 4, - // group: selectedMenuItem, - // onChanged: updateSelectedMenuItem, - // ), - // const SizedBox( - // height: 2, - // ), - // SettingsMenuItem( - // icon: SvgPicture.asset( - // Assets.svg.polygon, - // width: 11, - // height: 11, - // color: selectedMenuItem == 5 - // ? Theme.of(context) - // .extension()! - // .accentColorBlue - // : Colors.transparent, - // ), - // label: "Syncing preferences", - // value: 5, - // group: selectedMenuItem, - // onChanged: updateSelectedMenuItem, - // ), - // const SizedBox( - // height: 2, - // ), - // SettingsMenuItem( - // icon: SvgPicture.asset( - // Assets.svg.polygon, - // width: 11, - // height: 11, - // color: selectedMenuItem == 6 - // ? Theme.of(context) - // .extension()! - // .accentColorBlue - // : Colors.transparent, - // ), - // label: "Appearance", - // value: 6, - // group: selectedMenuItem, - // onChanged: updateSelectedMenuItem, - // ), - // const SizedBox( - // height: 2, - // ), - // SettingsMenuItem( - // icon: SvgPicture.asset( - // Assets.svg.polygon, - // width: 11, - // height: 11, - // color: selectedMenuItem == 7 - // ? Theme.of(context) - // .extension()! - // .accentColorBlue - // : Colors.transparent, - // ), - // label: "Advanced", - // value: 7, - // group: selectedMenuItem, - // onChanged: updateSelectedMenuItem, - // ), + ), ], ), ), diff --git a/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/advanced_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/advanced_settings.dart index a514da74d..1a11320c0 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/advanced_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/advanced_settings.dart @@ -219,44 +219,6 @@ class _AdvancedSettings extends ConsumerState { thickness: 0.5, ), ), - Padding( - padding: const EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Debug info", - style: STextStyles.desktopTextExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textDark), - textAlign: TextAlign.left, - ), - PrimaryButton( - buttonHeight: ButtonHeight.xs, - label: "Show logs", - width: 101, - onPressed: () async { - await showDialog( - context: context, - useSafeArea: false, - barrierDismissible: true, - builder: (context) { - return const DebugInfoDialog(); - }, - ); - }, - ), - ], - ), - ), - const Padding( - padding: EdgeInsets.all(10.0), - child: Divider( - thickness: 0.5, - ), - ), Padding( padding: const EdgeInsets.all(10), child: Row( @@ -327,6 +289,44 @@ class _AdvancedSettings extends ConsumerState { ], ), ), + const Padding( + padding: EdgeInsets.all(10.0), + child: Divider( + thickness: 0.5, + ), + ), + Padding( + padding: const EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Debug info", + style: STextStyles.desktopTextExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textDark), + textAlign: TextAlign.left, + ), + PrimaryButton( + buttonHeight: ButtonHeight.xs, + label: "Show logs", + width: 101, + onPressed: () async { + await showDialog( + context: context, + useSafeArea: false, + barrierDismissible: true, + builder: (context) { + return const DebugInfoDialog(); + }, + ); + }, + ), + ], + ), + ), const SizedBox( height: 10, ), diff --git a/lib/providers/exchange/exchange_form_state_provider.dart b/lib/providers/exchange/exchange_form_state_provider.dart index 07447f169..b4a923b78 100644 --- a/lib/providers/exchange/exchange_form_state_provider.dart +++ b/lib/providers/exchange/exchange_form_state_provider.dart @@ -13,8 +13,12 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/exchange/active_pair.dart'; import 'package:stackwallet/models/exchange/response_objects/estimate.dart'; import 'package:stackwallet/models/exchange/response_objects/range.dart'; +import 'package:stackwallet/providers/global/locale_provider.dart'; import 'package:stackwallet/services/exchange/exchange.dart'; import 'package:stackwallet/services/exchange/exchange_response.dart'; +import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/exchange_rate_type_enum.dart'; import 'package:tuple/tuple.dart'; @@ -44,7 +48,22 @@ final efSendAmountStringProvider = StateProvider((ref) { if (refreshing && reversed) { return "-"; } else { - return ref.watch(efSendAmountProvider)?.toString() ?? ""; + final decimal = ref.watch(efSendAmountProvider); + String string = ""; + if (decimal != null) { + final amount = Amount.fromDecimal(decimal, fractionDigits: decimal.scale); + final locale = ref.watch(localeServiceChangeNotifierProvider).locale; + string = AmountUnit.normal.displayAmount( + amount: amount, + locale: locale, + coin: Coin + .nano, // use nano just to ensure decimal.scale < Coin.value.decimals + withUnitName: false, + maxDecimalPlaces: decimal.scale, + ); + } + + return string; } }); final efReceiveAmountStringProvider = StateProvider((ref) { @@ -54,7 +73,22 @@ final efReceiveAmountStringProvider = StateProvider((ref) { if (refreshing && reversed == false) { return "-"; } else { - return ref.watch(efReceiveAmountProvider)?.toString() ?? ""; + final decimal = ref.watch(efReceiveAmountProvider); + String string = ""; + if (decimal != null) { + final amount = Amount.fromDecimal(decimal, fractionDigits: decimal.scale); + final locale = ref.watch(localeServiceChangeNotifierProvider).locale; + string = AmountUnit.normal.displayAmount( + amount: amount, + locale: locale, + coin: Coin + .nano, // use nano just to ensure decimal.scale < Coin.value.decimals + withUnitName: false, + maxDecimalPlaces: decimal.scale, + ); + } + + return string; } }); diff --git a/lib/services/coins/dogecoin/dogecoin_wallet.dart b/lib/services/coins/dogecoin/dogecoin_wallet.dart index bfb8251bc..754834ad1 100644 --- a/lib/services/coins/dogecoin/dogecoin_wallet.dart +++ b/lib/services/coins/dogecoin/dogecoin_wallet.dart @@ -2665,7 +2665,10 @@ class DogecoinWallet extends CoinServiceAPI Logging.instance .log("Starting buildTransaction ----------", level: LogLevel.Info); - final txb = TransactionBuilder(network: network); + final txb = TransactionBuilder( + network: network, + maximumFeeRate: 2500000, // 1000x default value in bitcoindart lib + ); txb.setVersion(1); // Add transaction inputs diff --git a/lib/services/coins/epiccash/epiccash_wallet.dart b/lib/services/coins/epiccash/epiccash_wallet.dart index 1cf75396b..b62129248 100644 --- a/lib/services/coins/epiccash/epiccash_wallet.dart +++ b/lib/services/coins/epiccash/epiccash_wallet.dart @@ -156,6 +156,7 @@ Future executeNative(Map arguments) async { final secretKeyIndex = arguments['secretKeyIndex'] as int?; final epicboxConfig = arguments['epicboxConfig'] as String?; final minimumConfirmations = arguments['minimumConfirmations'] as int?; + final onChainNote = arguments['onChainNote'] as String?; Map result = {}; if (!(wallet == null || @@ -165,7 +166,7 @@ Future executeNative(Map arguments) async { epicboxConfig == null || minimumConfirmations == null)) { var res = await createTransaction(wallet, amount, address, - secretKeyIndex, epicboxConfig, minimumConfirmations); + secretKeyIndex, epicboxConfig, minimumConfirmations, onChainNote!); result['result'] = res; sendPort.send(result); return; @@ -175,7 +176,7 @@ Future executeNative(Map arguments) async { final selectionStrategyIsAll = arguments['selectionStrategyIsAll'] as int?; final minimumConfirmations = arguments['minimumConfirmations'] as int?; - final message = arguments['message'] as String?; + final message = arguments['onChainNote'] as String?; final amount = arguments['amount'] as int?; final address = arguments['address'] as String?; @@ -459,6 +460,7 @@ class EpicCashWallet extends CoinServiceAPI // TODO determine whether it is worth sending change to a change address. dynamic message; + print("THIS TX DATA IS $txData"); String receiverAddress = txData['addresss'] as String; @@ -480,7 +482,7 @@ class EpicCashWallet extends CoinServiceAPI "wallet": wallet!, "selectionStrategyIsAll": selectionStrategyIsAll, "minimumConfirmations": MINIMUM_CONFIRMATIONS, - "message": "", + "message": txData['onChainNote'], "amount": (txData['recipientAmt'] as Amount).raw.toInt(), "address": txData['addresss'] as String, }, name: walletName); @@ -504,6 +506,7 @@ class EpicCashWallet extends CoinServiceAPI "secretKeyIndex": 0, "epicboxConfig": epicboxConfig.toString(), "minimumConfirmations": MINIMUM_CONFIRMATIONS, + "onChainNote": txData['onChainNote'], }, name: walletName); message = await receivePort.first; @@ -1721,6 +1724,8 @@ class EpicCashWallet extends CoinServiceAPI ""; String? commitId = slatesToCommits[slateId]?['commitId'] as String?; tx['numberOfMessages'] = tx['messages']?['messages']?.length; + tx['onChainNote'] = tx['messages']?['messages']?[0]?['message']; + print("ON CHAIN MESSAGE IS ${tx['onChainNote']}"); int? height; @@ -1754,7 +1759,8 @@ class EpicCashWallet extends CoinServiceAPI isLelantus: false, slateId: slateId, nonce: null, - otherData: tx["id"].toString(), + // otherData: tx["id"].toString(), + otherData: tx['onChainNote'].toString(), inputs: [], outputs: [], numberOfMessages: ((tx["numberOfMessages"] == null) ? 0 : tx["numberOfMessages"]) as int, diff --git a/lib/services/coins/ethereum/ethereum_wallet.dart b/lib/services/coins/ethereum/ethereum_wallet.dart index 9990406d9..62f3020e0 100644 --- a/lib/services/coins/ethereum/ethereum_wallet.dart +++ b/lib/services/coins/ethereum/ethereum_wallet.dart @@ -1023,6 +1023,7 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { final response = await EthereumAPI.getEthTransactions( address: thisAddress, firstBlock: isRescan ? 0 : firstBlock, + includeTokens: true, ); if (response.value == null) { @@ -1057,8 +1058,10 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { txFailed = true; } isIncoming = false; - } else { + } else if (checksumEthereumAddress(element.to) == thisAddress) { isIncoming = true; + } else { + continue; } //Calculate fees (GasLimit * gasPrice) diff --git a/lib/services/ethereum/ethereum_api.dart b/lib/services/ethereum/ethereum_api.dart index d30b9ea27..663513bea 100644 --- a/lib/services/ethereum/ethereum_api.dart +++ b/lib/services/ethereum/ethereum_api.dart @@ -50,6 +50,7 @@ abstract class EthereumAPI { static Future>> getEthTransactions({ required String address, int firstBlock = 0, + bool includeTokens = false, }) async { try { final response = await get( @@ -67,7 +68,7 @@ abstract class EthereumAPI { for (final map in list!) { final txn = EthTxDTO.fromMap(Map.from(map as Map)); - if (txn.hasToken == 0) { + if (txn.hasToken == 0 || includeTokens) { txns.add(txn); } } @@ -76,9 +77,11 @@ abstract class EthereumAPI { null, ); } else { - throw EthApiException( - "getEthTransactions($address) response is empty but status code is " - "${response.statusCode}", + // nice that the api returns an empty body instead of being + // consistent and returning a json object with no transactions + return EthereumResponse( + [], + null, ); } } else { @@ -196,9 +199,11 @@ abstract class EthereumAPI { null, ); } else { - throw EthApiException( - "getEthTransactionNonces($txns) response is empty but status code is " - "${response.statusCode}", + // nice that the api returns an empty body instead of being + // consistent and returning a json object with no transactions + return EthereumResponse( + [], + null, ); } } else { @@ -252,13 +257,13 @@ abstract class EthereumAPI { ); } else { throw EthApiException( - "getEthTransaction($txids) response is empty but status code is " + "getEthTokenTransactionsByTxids($txids) response is empty but status code is " "${response.statusCode}", ); } } else { throw EthApiException( - "getEthTransaction($txids) failed with status code: " + "getEthTokenTransactionsByTxids($txids) failed with status code: " "${response.statusCode}", ); } @@ -269,7 +274,7 @@ abstract class EthereumAPI { ); } catch (e, s) { Logging.instance.log( - "getEthTransaction($txids): $e\n$s", + "getEthTokenTransactionsByTxids($txids): $e\n$s", level: LogLevel.Error, ); return EthereumResponse( @@ -307,9 +312,11 @@ abstract class EthereumAPI { null, ); } else { - throw EthApiException( - "getTokenTransactions($address, $tokenContractAddress) response is empty but status code is " - "${response.statusCode}", + // nice that the api returns an empty body instead of being + // consistent and returning a json object with no transactions + return EthereumResponse( + [], + null, ); } } else { diff --git a/lib/services/ethereum/ethereum_token_service.dart b/lib/services/ethereum/ethereum_token_service.dart index ebe55c73e..a42867485 100644 --- a/lib/services/ethereum/ethereum_token_service.dart +++ b/lib/services/ethereum/ethereum_token_service.dart @@ -449,6 +449,15 @@ class EthTokenWallet extends ChangeNotifier with EthTokenCache { ); if (response.value == null) { + if (response.exception != null && + response.exception!.message + .contains("response is empty but status code is 200")) { + Logging.instance.log( + "No ${tokenContract.name} transfers found for $addressString", + level: LogLevel.Info, + ); + return; + } throw response.exception ?? Exception("Failed to fetch token transaction data"); } diff --git a/lib/services/exchange/exchange_data_loading_service.dart b/lib/services/exchange/exchange_data_loading_service.dart index 6fefba289..ee0ed50a0 100644 --- a/lib/services/exchange/exchange_data_loading_service.dart +++ b/lib/services/exchange/exchange_data_loading_service.dart @@ -135,6 +135,9 @@ class ExchangeDataLoadingService { Future loadAll() async { if (!_locked) { _locked = true; + if (_isar == null) { + await initDB(); + } Logging.instance.log( "ExchangeDataLoadingService.loadAll starting...", level: LogLevel.Info, diff --git a/lib/services/locale_service.dart b/lib/services/locale_service.dart index 7f5cde716..8cfb6f765 100644 --- a/lib/services/locale_service.dart +++ b/lib/services/locale_service.dart @@ -21,7 +21,7 @@ class LocaleService extends ChangeNotifier { Future loadLocale({bool notify = true}) async { _locale = Platform.isWindows ? "en_US" - : await Devicelocale.currentLocale ?? "en_US"; + : (await Devicelocale.currentAsLocale)?.toString() ?? "en_US"; if (notify) { notifyListeners(); } diff --git a/lib/services/notifications_api.dart b/lib/services/notifications_api.dart index e1c42fabe..41e95387b 100644 --- a/lib/services/notifications_api.dart +++ b/lib/services/notifications_api.dart @@ -26,6 +26,7 @@ class NotificationApi { priority: Priority.high, ticker: 'ticker'), iOS: IOSNotificationDetails(), + macOS: MacOSNotificationDetails(), ); } @@ -34,8 +35,13 @@ class NotificationApi { const iOS = IOSInitializationSettings(); const linux = LinuxInitializationSettings( defaultActionName: "temporary_stack_wallet"); - const settings = - InitializationSettings(android: android, iOS: iOS, linux: linux); + const macOS = MacOSInitializationSettings(); + const settings = InitializationSettings( + android: android, + iOS: iOS, + linux: linux, + macOS: macOS, + ); await _notifications.initialize( settings, onSelectNotification: (payload) async { diff --git a/lib/services/price.dart b/lib/services/price.dart index 22f0e79aa..24d929062 100644 --- a/lib/services/price.dart +++ b/lib/services/price.dart @@ -80,7 +80,7 @@ class PriceAPI { {required String baseCurrency}) async { final now = DateTime.now(); if (_lastUsedBaseCurrency != baseCurrency || - now.difference(_lastCalled).inSeconds > 0) { + now.difference(_lastCalled) > refreshIntervalDuration) { _lastCalled = now; _lastUsedBaseCurrency = baseCurrency; } else { diff --git a/lib/themes/theme_service.dart b/lib/themes/theme_service.dart index c72d778b6..c9a8bd978 100644 --- a/lib/themes/theme_service.dart +++ b/lib/themes/theme_service.dart @@ -40,7 +40,7 @@ class ThemeService { void init(MainDB db) => _db ??= db; Future install({required Uint8List themeArchiveData}) async { - final themesDir = await StackFileSystem.applicationThemesDirectory(); + final themesDir = StackFileSystem.themesDir!; final archive = ZipDecoder().decodeBytes(themeArchiveData); @@ -55,7 +55,6 @@ class ThemeService { final theme = StackTheme.fromJson( json: Map.from(json), - applicationThemesDirectoryPath: themesDir.path, ); try { @@ -88,7 +87,7 @@ class ThemeService { } Future remove({required String themeId}) async { - final themesDir = await StackFileSystem.applicationThemesDirectory(); + final themesDir = StackFileSystem.themesDir!; final isarId = await db.isar.stackThemes .where() .themeIdEqualTo(themeId) @@ -157,20 +156,22 @@ class ThemeService { ); } else { // check installed version - final theme = ThemeService.instance.getTheme(themeId: "dark"); - if ((theme?.version ?? 1) < _currentDefaultThemeVersion) { - Logging.instance.log( - "Updating default dark theme...", - level: LogLevel.Info, - ); - final darkZip = await rootBundle.load("assets/default_themes/dark.zip"); - await ThemeService.instance - .install(themeArchiveData: darkZip.buffer.asUint8List()); - Logging.instance.log( - "Updating default dark theme... finished", - level: LogLevel.Info, - ); - } + // final theme = ThemeService.instance.getTheme(themeId: "dark"); + // Force update theme to add missing icons for now + // TODO: uncomment if statement in future when themes are version 4 or above + // if ((theme?.version ?? 1) < _currentDefaultThemeVersion) { + Logging.instance.log( + "Updating default dark theme...", + level: LogLevel.Info, + ); + final darkZip = await rootBundle.load("assets/default_themes/dark.zip"); + await ThemeService.instance + .install(themeArchiveData: darkZip.buffer.asUint8List()); + Logging.instance.log( + "Updating default dark theme... finished", + level: LogLevel.Info, + ); + // } } } @@ -185,7 +186,7 @@ class ThemeService { return false; } - final themesDir = await StackFileSystem.applicationThemesDirectory(); + final themesDir = StackFileSystem.themesDir!; final jsonFileExists = await File("${themesDir.path}/$themeId/theme.json").exists(); final assetsDirExists = diff --git a/lib/utilities/address_utils.dart b/lib/utilities/address_utils.dart index 93f776d98..0093e1d00 100644 --- a/lib/utilities/address_utils.dart +++ b/lib/utilities/address_utils.dart @@ -10,11 +10,11 @@ import 'dart:convert'; +import 'package:bitbox/bitbox.dart' as bitbox; import 'package:bitcoindart/bitcoindart.dart'; import 'package:crypto/crypto.dart'; import 'package:flutter_libepiccash/epic_cash.dart'; import 'package:nanodart/nanodart.dart'; -import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart'; import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart'; import 'package:stackwallet/services/coins/ecash/ecash_wallet.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; @@ -64,7 +64,27 @@ class AddressUtils { case Coin.litecoin: return Address.validateAddress(address, litecoin); case Coin.bitcoincash: - return Address.validateAddress(address, bitcoincash); + try { + // 0 for bitcoincash: address scheme, 1 for legacy address + final format = bitbox.Address.detectFormat(address); + + if (coin == Coin.bitcoincashTestnet) { + return true; + } + + if (format == bitbox.Address.formatCashAddr) { + String addr = address; + if (addr.contains(":")) { + addr = addr.split(":").last; + } + + return addr.startsWith("q"); + } else { + return address.startsWith("1"); + } + } catch (e) { + return false; + } case Coin.dogecoin: return Address.validateAddress(address, dogecoin); case Coin.epicCash: @@ -94,7 +114,27 @@ class AddressUtils { case Coin.litecoinTestNet: return Address.validateAddress(address, litecointestnet); case Coin.bitcoincashTestnet: - return Address.validateAddress(address, bitcoincashtestnet); + try { + // 0 for bitcoincash: address scheme, 1 for legacy address + final format = bitbox.Address.detectFormat(address); + + if (coin == Coin.bitcoincashTestnet) { + return true; + } + + if (format == bitbox.Address.formatCashAddr) { + String addr = address; + if (addr.contains(":")) { + addr = addr.split(":").last; + } + + return addr.startsWith("q"); + } else { + return address.startsWith("1"); + } + } catch (e) { + return false; + } case Coin.firoTestNet: return Address.validateAddress(address, firoTestNetwork); case Coin.dogecoinTestNet: @@ -126,7 +166,17 @@ class AddressUtils { String address, Map params, ) { - String uriString = "${coin.uriScheme}:$address"; + // TODO: other sanitation as well ? + String sanitizedAddress = address; + if (coin == Coin.bitcoincash || + coin == Coin.bitcoincashTestnet || + coin == Coin.eCash) { + final prefix = "${coin.uriScheme}:"; + if (address.startsWith(prefix)) { + sanitizedAddress = address.replaceFirst(prefix, ""); + } + } + String uriString = "${coin.uriScheme}:$sanitizedAddress"; if (params.isNotEmpty) { uriString += Uri(queryParameters: params).toString(); } diff --git a/lib/utilities/amount/amount.dart b/lib/utilities/amount/amount.dart index 0e8790064..0014a4eab 100644 --- a/lib/utilities/amount/amount.dart +++ b/lib/utilities/amount/amount.dart @@ -11,8 +11,7 @@ import 'dart:convert'; import 'package:decimal/decimal.dart'; -import 'package:intl/number_symbols.dart'; -import 'package:intl/number_symbols_data.dart'; +import 'package:stackwallet/utilities/util.dart'; class Amount { Amount({ @@ -52,8 +51,7 @@ class Amount { } // get number symbols for decimal place and group separator - final numberSymbols = numberFormatSymbols[locale] as NumberSymbols? ?? - numberFormatSymbols[locale.substring(0, 2)] as NumberSymbols?; + final numberSymbols = Util.getSymbolsFor(locale: locale); final groupSeparator = numberSymbols?.GROUP_SEP ?? ","; final decimalSeparator = numberSymbols?.DECIMAL_SEP ?? "."; @@ -101,8 +99,7 @@ class Amount { final wholeNumber = decimal.truncate(); // get number symbols for decimal place and group separator - final numberSymbols = numberFormatSymbols[locale] as NumberSymbols? ?? - numberFormatSymbols[locale.substring(0, 2)] as NumberSymbols?; + final numberSymbols = Util.getSymbolsFor(locale: locale); final String separator = numberSymbols?.DECIMAL_SEP ?? "."; diff --git a/lib/utilities/amount/amount_formatter.dart b/lib/utilities/amount/amount_formatter.dart index 7c5a8f29b..1ae577507 100644 --- a/lib/utilities/amount/amount_formatter.dart +++ b/lib/utilities/amount/amount_formatter.dart @@ -22,11 +22,13 @@ final pMaxDecimals = Provider.family( ); final pAmountFormatter = Provider.family((ref, coin) { + final locale = ref.watch( + localeServiceChangeNotifierProvider.select((value) => value.locale), + ); + return AmountFormatter( unit: ref.watch(pAmountUnit(coin)), - locale: ref.watch( - localeServiceChangeNotifierProvider.select((value) => value.locale), - ), + locale: locale, coin: coin, maxDecimals: ref.watch(pMaxDecimals(coin)), ); @@ -68,6 +70,11 @@ class AmountFormatter { String string, { EthContract? ethContract, }) { - return unit.tryParse(string, locale: locale, coin: coin); + return unit.tryParse( + string, + locale: locale, + coin: coin, + tokenContract: ethContract, + ); } } diff --git a/lib/utilities/amount/amount_input_formatter.dart b/lib/utilities/amount/amount_input_formatter.dart index c3157c6fa..2ac5d7871 100644 --- a/lib/utilities/amount/amount_input_formatter.dart +++ b/lib/utilities/amount/amount_input_formatter.dart @@ -1,9 +1,8 @@ import 'dart:math'; import 'package:flutter/services.dart'; -import 'package:intl/number_symbols.dart'; -import 'package:intl/number_symbols_data.dart'; import 'package:stackwallet/utilities/amount/amount_unit.dart'; +import 'package:stackwallet/utilities/util.dart'; class AmountInputFormatter extends TextInputFormatter { final int decimals; @@ -20,8 +19,7 @@ class AmountInputFormatter extends TextInputFormatter { TextEditingValue formatEditUpdate( TextEditingValue oldValue, TextEditingValue newValue) { // get number symbols for decimal place and group separator - final numberSymbols = numberFormatSymbols[locale] as NumberSymbols? ?? - numberFormatSymbols[locale.substring(0, 2)] as NumberSymbols?; + final numberSymbols = Util.getSymbolsFor(locale: locale); final decimalSeparator = numberSymbols?.DECIMAL_SEP ?? "."; final groupSeparator = numberSymbols?.GROUP_SEP ?? ","; @@ -38,7 +36,15 @@ class AmountInputFormatter extends TextInputFormatter { if (parts.length > 2) { return oldValue; } + + final fractionDigits = + unit == null ? decimals : max(decimals - unit!.shift, 0); + if (newText.startsWith(decimalSeparator)) { + if (newText.length - 1 > fractionDigits) { + newText = newText.substring(0, fractionDigits + 1); + } + return TextEditingValue( text: newText, selection: TextSelection.collapsed( @@ -54,28 +60,24 @@ class AmountInputFormatter extends TextInputFormatter { fraction = ""; } - final fractionDigits = - unit == null ? decimals : max(decimals - unit!.shift, 0); - if (fraction.length > fractionDigits) { - return oldValue; + fraction = fraction.substring(0, fractionDigits); } } - if (newText.trim() == '' || newText.trim() == '0') { - return newValue.copyWith(text: ''); - } else if (BigInt.parse(newText) < BigInt.one) { - return newValue.copyWith(text: ''); + String newString; + final val = BigInt.tryParse(newText); + if (val == null || val < BigInt.one) { + newString = newText; + } else { + // insert group separator + final regex = RegExp(r'\B(?=(\d{3})+(?!\d))'); + newString = newText.replaceAllMapped( + regex, + (m) => "${m.group(0)}${numberSymbols?.GROUP_SEP ?? ","}", + ); } - // insert group separator - final regex = RegExp(r'\B(?=(\d{3})+(?!\d))'); - - String newString = newText.replaceAllMapped( - regex, - (m) => "${m.group(0)}${numberSymbols?.GROUP_SEP ?? ","}", - ); - if (fraction != null) { newString += decimalSeparator; if (fraction.isNotEmpty) { diff --git a/lib/utilities/amount/amount_unit.dart b/lib/utilities/amount/amount_unit.dart index 79b36130f..91fef8bc7 100644 --- a/lib/utilities/amount/amount_unit.dart +++ b/lib/utilities/amount/amount_unit.dart @@ -11,11 +11,10 @@ import 'dart:math' as math; import 'package:decimal/decimal.dart'; -import 'package:intl/number_symbols.dart'; -import 'package:intl/number_symbols_data.dart'; import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/util.dart'; // preserve index order as index is used to store value in preferences enum AmountUnit { @@ -169,6 +168,7 @@ extension AmountUnitExt on AmountUnit { required String locale, required Coin coin, EthContract? tokenContract, + bool overrideWithDecimalPlacesFromString = false, }) { final precisionLost = value.startsWith("~"); @@ -188,8 +188,7 @@ extension AmountUnitExt on AmountUnit { } // get number symbols for decimal place and group separator - final numberSymbols = numberFormatSymbols[locale] as NumberSymbols? ?? - numberFormatSymbols[locale.substring(0, 2)] as NumberSymbols?; + final numberSymbols = Util.getSymbolsFor(locale: locale); final groupSeparator = numberSymbols?.GROUP_SEP ?? ","; final decimalSeparator = numberSymbols?.DECIMAL_SEP ?? "."; @@ -203,7 +202,9 @@ extension AmountUnitExt on AmountUnit { return null; } - final decimalPlaces = tokenContract?.decimals ?? coin.decimals; + final decimalPlaces = overrideWithDecimalPlacesFromString + ? decimal.scale + : tokenContract?.decimals ?? coin.decimals; final realShift = math.min(shift, decimalPlaces); return decimal.shift(0 - realShift).toAmount(fractionDigits: decimalPlaces); @@ -237,8 +238,7 @@ extension AmountUnitExt on AmountUnit { String returnValue = wholeNumber.toString(); // get number symbols for decimal place and group separator - final numberSymbols = numberFormatSymbols[locale] as NumberSymbols? ?? - numberFormatSymbols[locale.substring(0, 2)] as NumberSymbols?; + final numberSymbols = Util.getSymbolsFor(locale: locale); // insert group separator final regex = RegExp(r'\B(?=(\d{3})+(?!\d))'); diff --git a/lib/utilities/assets.dart b/lib/utilities/assets.dart index 7f92a9d1d..b8ec501e8 100644 --- a/lib/utilities/assets.dart +++ b/lib/utilities/assets.dart @@ -65,8 +65,8 @@ class _EXCHANGE { class _BUY { const _BUY(); - String simplexLogo(BuildContext context) { - switch (MediaQuery.of(context).platformBrightness) { + String simplexLogo(Brightness themeBrightness) { + switch (themeBrightness) { case Brightness.dark: return "assets/svg/buy/Simplex-Nuvei-Logo-light.svg"; diff --git a/lib/utilities/db_version_migration.dart b/lib/utilities/db_version_migration.dart index cc58818bc..293b5d48c 100644 --- a/lib/utilities/db_version_migration.dart +++ b/lib/utilities/db_version_migration.dart @@ -178,10 +178,8 @@ class DbVersionMigrator with WalletDB { case 3: // clear possible broken firo cache - await DB.instance.deleteBoxFromDisk( - boxName: DB.instance.boxNameSetCache(coin: Coin.firo)); - await DB.instance.deleteBoxFromDisk( - boxName: DB.instance.boxNameUsedSerialsCache(coin: Coin.firo)); + await DB.instance.clearSharedTransactionCache(coin: Coin.firo); + // update version await DB.instance.put( diff --git a/lib/utilities/delete_everything.dart b/lib/utilities/delete_everything.dart deleted file mode 100644 index 65a1c36a4..000000000 --- a/lib/utilities/delete_everything.dart +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 - * - */ - -import 'package:stackwallet/db/hive/db.dart'; -import 'package:stackwallet/utilities/logger.dart'; - -Future deleteEverything() async { - try { - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameAddressBook); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameDebugInfo); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameNodeModels); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNamePrimaryNodes); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameAllWalletsData); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameNotifications); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameWatchedTransactions); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameWatchedTrades); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTrades); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTradesV2); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTradeNotes); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTradeLookup); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameFavoriteWallets); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNamePrefs); - await DB.instance - .deleteBoxFromDisk(boxName: DB.boxNameWalletsToDeleteOnStart); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNamePriceCache); - await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameDBInfo); - await DB.instance.deleteBoxFromDisk(boxName: "theme"); - return true; - } catch (e, s) { - Logging.instance.log("$e $s", level: LogLevel.Error); - return false; - } -} diff --git a/lib/utilities/desktop_password_service.dart b/lib/utilities/desktop_password_service.dart index c2de6c72f..edf1059a6 100644 --- a/lib/utilities/desktop_password_service.dart +++ b/lib/utilities/desktop_password_service.dart @@ -10,9 +10,9 @@ import 'package:hive/hive.dart'; import 'package:stack_wallet_backup/secure_storage.dart'; -import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/utilities/logger.dart'; +const String kBoxNameDesktopData = "desktopData"; const String _kKeyBlobKey = "swbKeyBlobKeyStringID"; const String _kKeyBlobVersionKey = "swbKeyBlobVersionKeyStringID"; @@ -62,14 +62,8 @@ class DPS { kLatestBlobVersion, ); - final box = await Hive.openBox(DB.boxNameDesktopData); - await DB.instance.put( - boxName: DB.boxNameDesktopData, - key: _kKeyBlobKey, - value: await _handler!.getKeyBlob(), - ); + await _put(key: _kKeyBlobKey, value: await _handler!.getKeyBlob()); await _updateStoredKeyBlobVersion(kLatestBlobVersion); - await box.close(); } catch (e, s) { Logging.instance.log( "${_getMessageFromException(e)}\n$s", @@ -85,19 +79,13 @@ class DPS { "DPS: attempted to re initialize with existing passphrase"); } - final box = await Hive.openBox(DB.boxNameDesktopData); - final keyBlob = DB.instance.get( - boxName: DB.boxNameDesktopData, - key: _kKeyBlobKey, - ); - await box.close(); - - if (keyBlob == null) { - throw Exception( - "DPS: failed to find keyBlob while attempting to initialize with existing passphrase"); - } - try { + final keyBlob = await _get(key: _kKeyBlobKey); + + if (keyBlob == null) { + throw Exception( + "DPS: failed to find keyBlob while attempting to initialize with existing passphrase"); + } final blobVersion = await _getStoredKeyBlobVersion(); _handler = await StorageCryptoHandler.fromExisting( passphrase, @@ -107,14 +95,8 @@ class DPS { if (blobVersion < kLatestBlobVersion) { // update blob await _handler!.resetPassphrase(passphrase, kLatestBlobVersion); - final box = await Hive.openBox(DB.boxNameDesktopData); - await DB.instance.put( - boxName: DB.boxNameDesktopData, - key: _kKeyBlobKey, - value: await _handler!.getKeyBlob(), - ); + await _put(key: _kKeyBlobKey, value: await _handler!.getKeyBlob()); await _updateStoredKeyBlobVersion(kLatestBlobVersion); - await box.close(); } } catch (e, s) { Logging.instance.log( @@ -126,19 +108,13 @@ class DPS { } Future verifyPassphrase(String passphrase) async { - final box = await Hive.openBox(DB.boxNameDesktopData); - final keyBlob = DB.instance.get( - boxName: DB.boxNameDesktopData, - key: _kKeyBlobKey, - ); - await box.close(); - - if (keyBlob == null) { - // no passphrase key blob found so any passphrase is technically bad - return false; - } - try { + final keyBlob = await _get(key: _kKeyBlobKey); + + if (keyBlob == null) { + // no passphrase key blob found so any passphrase is technically bad + return false; + } final blobVersion = await _getStoredKeyBlobVersion(); await StorageCryptoHandler.fromExisting(passphrase, keyBlob, blobVersion); // existing passphrase matches key blob @@ -157,35 +133,25 @@ class DPS { String passphraseOld, String passphraseNew, ) async { - final box = await Hive.openBox(DB.boxNameDesktopData); - final keyBlob = DB.instance.get( - boxName: DB.boxNameDesktopData, - key: _kKeyBlobKey, - ); - await box.close(); - - if (keyBlob == null) { - // no passphrase key blob found so any passphrase is technically bad - return false; - } - - if (!(await verifyPassphrase(passphraseOld))) { - return false; - } - - final blobVersion = await _getStoredKeyBlobVersion(); - try { - await _handler!.resetPassphrase(passphraseNew, blobVersion); + final keyBlob = await _get(key: _kKeyBlobKey); - final box = await Hive.openBox(DB.boxNameDesktopData); - await DB.instance.put( - boxName: DB.boxNameDesktopData, + if (keyBlob == null) { + // no passphrase key blob found so any passphrase is technically bad + return false; + } + + if (!(await verifyPassphrase(passphraseOld))) { + return false; + } + + final blobVersion = await _getStoredKeyBlobVersion(); + await _handler!.resetPassphrase(passphraseNew, blobVersion); + await _put( key: _kKeyBlobKey, value: await _handler!.getKeyBlob(), ); await _updateStoredKeyBlobVersion(blobVersion); - await box.close(); // successfully updated passphrase return true; @@ -199,28 +165,54 @@ class DPS { } Future hasPassword() async { - final keyBlob = DB.instance.get( - boxName: DB.boxNameDesktopData, - key: _kKeyBlobKey, - ); + final keyBlob = await _get(key: _kKeyBlobKey); return keyBlob != null; } Future _getStoredKeyBlobVersion() async { - final box = await Hive.openBox(DB.boxNameDesktopData); - final keyBlobVersionString = DB.instance.get( - boxName: DB.boxNameDesktopData, - key: _kKeyBlobVersionKey, - ); - await box.close(); + final keyBlobVersionString = await _get(key: _kKeyBlobVersionKey); return int.tryParse(keyBlobVersionString ?? "1") ?? 1; } Future _updateStoredKeyBlobVersion(int version) async { - await DB.instance.put( - boxName: DB.boxNameDesktopData, - key: _kKeyBlobVersionKey, - value: version.toString(), - ); + await _put(key: _kKeyBlobVersionKey, value: version.toString()); + } + + Future _put({required String key, required String value}) async { + Box? box; + try { + box = await Hive.openBox(kBoxNameDesktopData); + await box.put(key, value); + } catch (e, s) { + Logging.instance.log( + "DPS failed put($key): $e\n$s", + level: LogLevel.Fatal, + ); + } finally { + await box?.close(); + } + } + + Future _get({required String key}) async { + String? value; + Box? box; + try { + box = await Hive.openBox(kBoxNameDesktopData); + value = box.get(key); + } catch (e, s) { + Logging.instance.log( + "DPS failed get($key): $e\n$s", + level: LogLevel.Fatal, + ); + } finally { + await box?.close(); + } + return value; + } + + /// Dangerous. Used in one place and should not be called anywhere else. + @Deprecated("Don't use this if at all possible") + Future deleteBox() async { + await Hive.deleteBoxFromDisk(kBoxNameDesktopData); } } diff --git a/lib/utilities/extensions/impl/box_shadow.dart b/lib/utilities/extensions/impl/box_shadow.dart index 39dd84c4e..367599d49 100644 --- a/lib/utilities/extensions/impl/box_shadow.dart +++ b/lib/utilities/extensions/impl/box_shadow.dart @@ -10,35 +10,6 @@ import 'package:flutter/material.dart'; -// todo: delete this map (example) -final map = { - "name": "Dark", - "coinColors": { - "bitcoin": "0xFF267352", - }, - "assets": { - "circleLock": "svg/somerandomnamecreatedbythemecreator.svg", - }, - "colors": { - "background": "0xFF848383", - }, - "gradientBackground": { - "gradientType": "linear", - "begin": { - "x": 0.0, - "y": 1.0, - }, - "end": { - "x": -1.0, - "y": 1.0, - }, - "colors": [ - "0xFF638227", - "0xFF632827", - ] - } -}; - extension BoxShadowExt on BoxShadow { static BoxShadow fromJson(Map json) => BoxShadow( color: Color(int.parse(json["color"] as String)), diff --git a/lib/utilities/stack_file_system.dart b/lib/utilities/stack_file_system.dart index 2bb7b5d80..f36fadf01 100644 --- a/lib/utilities/stack_file_system.dart +++ b/lib/utilities/stack_file_system.dart @@ -27,8 +27,8 @@ abstract class StackFileSystem { } else if (Platform.isWindows) { appDirectory = await getApplicationSupportDirectory(); } else if (Platform.isMacOS) { - // currently run in ipad mode?? - throw Exception("Unsupported platform"); + appDirectory = await getLibraryDirectory(); + appDirectory = Directory("${appDirectory.path}/stackwallet"); } else if (Platform.isIOS) { // todo: check if we need different behaviour here if (Util.isDesktop) { @@ -73,16 +73,15 @@ abstract class StackFileSystem { } } - static Future applicationThemesDirectory() async { + static Future initThemesDir() async { final root = await applicationRootDirectory(); - // if (Util.isDesktop) { + final dir = Directory("${root.path}/themes"); if (!dir.existsSync()) { await dir.create(); } - return dir; - // } else { - // return root; - // } + themesDir = dir; } + + static Directory? themesDir; } diff --git a/lib/utilities/util.dart b/lib/utilities/util.dart index 265cd2e06..c73f697cc 100644 --- a/lib/utilities/util.dart +++ b/lib/utilities/util.dart @@ -14,11 +14,21 @@ import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/material.dart'; +import 'package:intl/number_symbols.dart'; +import 'package:intl/number_symbols_data.dart'; abstract class Util { static Directory? libraryPath; static double? screenWidth; + static NumberSymbols? getSymbolsFor({required String locale}) { + return numberFormatSymbols[locale] as NumberSymbols? ?? + numberFormatSymbols[locale.replaceAll("-", "_")] as NumberSymbols? ?? + numberFormatSymbols[locale.substring(3).toLowerCase()] + as NumberSymbols? ?? + numberFormatSymbols[locale.substring(0, 2)] as NumberSymbols?; + } + static bool get isDesktop { // special check for running on linux based phones if (Platform.isLinux && screenWidth != null && screenWidth! < 800) { diff --git a/lib/widgets/address_book_card.dart b/lib/widgets/address_book_card.dart index fed6deb03..f40f4f432 100644 --- a/lib/widgets/address_book_card.dart +++ b/lib/widgets/address_book_card.dart @@ -70,9 +70,10 @@ class _AddressBookCardState extends ConsumerState { final contact = _contact!; final List coins = []; - for (var element in contact.addresses) { - if (!coins.contains(element.coin)) { - coins.add(element.coin); + + for (final coin in Coin.values) { + if (contact.addresses.where((e) => e.coin == coin).isNotEmpty) { + coins.add(coin); } } diff --git a/lib/widgets/desktop/desktop_fee_dialog.dart b/lib/widgets/desktop/desktop_fee_dialog.dart index f2c8c9fba..d9bf51190 100644 --- a/lib/widgets/desktop/desktop_fee_dialog.dart +++ b/lib/widgets/desktop/desktop_fee_dialog.dart @@ -16,6 +16,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/animated_text.dart'; +import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart'; @@ -234,6 +235,7 @@ class DesktopFeeItem extends ConsumerStatefulWidget { required this.walletId, required this.feeFor, required this.isSelected, + this.isButton = true, }) : super(key: key); final FeeObject? feeObject; @@ -246,6 +248,7 @@ class DesktopFeeItem extends ConsumerStatefulWidget { required Coin coin, }) feeFor; final bool isSelected; + final bool isButton; @override ConsumerState createState() => _DesktopFeeItemState(); @@ -291,19 +294,50 @@ class _DesktopFeeItemState extends ConsumerState { Widget build(BuildContext context) { debugPrint("BUILD: $runtimeType : ${widget.feeRateType}"); - return MaterialButton( - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - onPressed: () { - Navigator.of(context).pop( - ( - widget.feeRateType, - feeString, - timeString, - ), - ); - }, + return ConditionalParent( + condition: widget.isButton, + builder: (child) => MaterialButton( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + onPressed: () { + Navigator.of(context).pop( + ( + widget.feeRateType, + feeString, + timeString, + ), + ); + }, + child: child, + ), child: Builder( builder: (_) { + if (!widget.isButton) { + final coin = ref.watch( + walletsChangeNotifierProvider.select( + (value) => value.getManager(widget.walletId).coin, + ), + ); + if ((coin == Coin.firo || coin == Coin.firoTestNet) && + ref.watch(publicPrivateBalanceStateProvider.state).state == + "Private") { + return Text( + "~${ref.watch(pAmountFormatter(coin)).format( + Amount( + rawValue: BigInt.parse("3794"), + fractionDigits: coin.decimals, + ), + indicatePrecisionLoss: false, + )}", + style: STextStyles.desktopTextExtraExtraSmall(context).copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveText, + ), + textAlign: TextAlign.left, + ); + } + } + if (widget.feeRateType == FeeRateType.custom) { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/widgets/fee_slider.dart b/lib/widgets/fee_slider.dart index 118cd7a85..d125988f3 100644 --- a/lib/widgets/fee_slider.dart +++ b/lib/widgets/fee_slider.dart @@ -1,14 +1,17 @@ import 'dart:math'; import 'package:flutter/material.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; class FeeSlider extends StatefulWidget { const FeeSlider({ super.key, required this.onSatVByteChanged, + required this.coin, }); + final Coin coin; final void Function(int) onSatVByteChanged; @override @@ -16,12 +19,12 @@ class FeeSlider extends StatefulWidget { } class _FeeSliderState extends State { - static const int min = 1; - static const int max = 4; + static const double min = 1; + static const double max = 4; double sliderValue = 0; - int rate = min; + int rate = min.toInt(); @override Widget build(BuildContext context) { @@ -45,7 +48,14 @@ class _FeeSliderState extends State { onChanged: (value) { setState(() { sliderValue = value; - rate = pow(sliderValue * (max - min) + min, 4).toInt(); + final number = pow(sliderValue * (max - min) + min, 4).toDouble(); + switch (widget.coin) { + case Coin.dogecoin: + case Coin.dogecoinTestNet: + rate = (number * 1000).toInt(); + default: + rate = number.toInt(); + } }); widget.onSatVByteChanged(rate); }, diff --git a/lib/widgets/transaction_card.dart b/lib/widgets/transaction_card.dart index 7791ff3a0..41b81e2da 100644 --- a/lib/widgets/transaction_card.dart +++ b/lib/widgets/transaction_card.dart @@ -230,7 +230,9 @@ class _TransactionCardState extends ConsumerState { fit: BoxFit.scaleDown, child: Text( _transaction.isCancelled - ? "Cancelled" + ? coin == Coin.ethereum + ? "Failed" + : "Cancelled" : whatIsIt( _transaction.type, coin, diff --git a/lib/widgets/wallet_card.dart b/lib/widgets/wallet_card.dart index 831b2077e..63b3a4a0e 100644 --- a/lib/widgets/wallet_card.dart +++ b/lib/widgets/wallet_card.dart @@ -26,6 +26,7 @@ import 'package:stackwallet/services/ethereum/ethereum_token_service.dart'; import 'package:stackwallet/services/transaction_notification_tracker.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/show_loading.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; @@ -136,17 +137,18 @@ class SimpleWalletCard extends ConsumerWidget { context: desktopNavigatorState?.context ?? context, opaqueBG: true, message: "Loading ${contract.name}", + isDesktop: Util.isDesktop, ); if (!success) { + // TODO: show error dialog here? + Logging.instance.log( + "Failed to load token wallet for $contract", + level: LogLevel.Error, + ); return; } - if (desktopNavigatorState == null) { - // pop loading - nav.pop(); - } - if (desktopNavigatorState != null) { await desktopNavigatorState!.pushNamed( DesktopTokenView.routeName, diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index b741c3c0a..b044b4b00 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,6 +6,9 @@ import FlutterMacOS import Foundation import connectivity_plus +import cw_monero +import cw_shared_external +import cw_wownero import desktop_drop import device_info_plus import devicelocale @@ -13,10 +16,10 @@ import flutter_libepiccash import flutter_local_notifications import flutter_secure_storage_macos import isar_flutter_libs +import lelantus import package_info_plus import path_provider_foundation import share_plus -import shared_preferences_foundation import stack_wallet_backup import url_launcher_macos import wakelock_macos @@ -24,6 +27,9 @@ import window_size func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) + CwMoneroPlugin.register(with: registry.registrar(forPlugin: "CwMoneroPlugin")) + CwSharedExternalPlugin.register(with: registry.registrar(forPlugin: "CwSharedExternalPlugin")) + CwWowneroPlugin.register(with: registry.registrar(forPlugin: "CwWowneroPlugin")) DesktopDropPlugin.register(with: registry.registrar(forPlugin: "DesktopDropPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin")) @@ -31,10 +37,10 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin")) + LelantusPlugin.register(with: registry.registrar(forPlugin: "LelantusPlugin")) FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) - SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) StackWalletBackupPlugin.register(with: registry.registrar(forPlugin: "StackWalletBackupPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin")) diff --git a/macos/Podfile b/macos/Podfile index dade8dfad..c795730db 100644 --- a/macos/Podfile +++ b/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -31,6 +31,9 @@ target 'Runner' do use_modular_headers! flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end end post_install do |installer| diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 82579cd8e..69c91af48 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -1,24 +1,76 @@ PODS: - - connectivity_plus_macos (0.0.1): + - connectivity_plus (0.0.1): - FlutterMacOS - ReachabilitySwift + - cw_monero (0.0.1): + - cw_monero/Boost (= 0.0.1) + - cw_monero/Monero (= 0.0.1) + - cw_monero/OpenSSL (= 0.0.1) + - cw_monero/Sodium (= 0.0.1) + - cw_monero/Unbound (= 0.0.1) + - FlutterMacOS + - cw_monero/Boost (0.0.1): + - FlutterMacOS + - cw_monero/Monero (0.0.1): + - FlutterMacOS + - cw_monero/OpenSSL (0.0.1): + - FlutterMacOS + - cw_monero/Sodium (0.0.1): + - FlutterMacOS + - cw_monero/Unbound (0.0.1): + - FlutterMacOS + - cw_shared_external (0.0.1): + - cw_shared_external/Boost (= 0.0.1) + - cw_shared_external/OpenSSL (= 0.0.1) + - cw_shared_external/Sodium (= 0.0.1) + - FlutterMacOS + - cw_shared_external/Boost (0.0.1): + - FlutterMacOS + - cw_shared_external/OpenSSL (0.0.1): + - FlutterMacOS + - cw_shared_external/Sodium (0.0.1): + - FlutterMacOS + - cw_wownero (0.0.1): + - cw_wownero/Boost (= 0.0.1) + - cw_wownero/OpenSSL (= 0.0.1) + - cw_wownero/Sodium (= 0.0.1) + - cw_wownero/Unbound (= 0.0.1) + - cw_wownero/Wownero (= 0.0.1) + - FlutterMacOS + - cw_wownero/Boost (0.0.1): + - FlutterMacOS + - cw_wownero/OpenSSL (0.0.1): + - FlutterMacOS + - cw_wownero/Sodium (0.0.1): + - FlutterMacOS + - cw_wownero/Unbound (0.0.1): + - FlutterMacOS + - cw_wownero/Wownero (0.0.1): + - FlutterMacOS + - desktop_drop (0.0.1): + - FlutterMacOS + - device_info_plus (0.0.1): + - FlutterMacOS + - devicelocale (0.0.1): + - FlutterMacOS - flutter_libepiccash (0.0.1): - FlutterMacOS - flutter_local_notifications (0.0.1): - FlutterMacOS - - flutter_secure_storage_macos (3.3.1): + - flutter_secure_storage_macos (6.1.1): - FlutterMacOS - FlutterMacOS (1.0.0) - isar_flutter_libs (1.0.0): - FlutterMacOS - - package_info_plus_macos (0.0.1): + - lelantus (0.0.1): - FlutterMacOS - - path_provider_macos (0.0.1): + - package_info_plus (0.0.1): + - FlutterMacOS + - path_provider_foundation (0.0.1): + - Flutter - FlutterMacOS - ReachabilitySwift (5.0.0) - - share_plus_macos (0.0.1): - - FlutterMacOS - - shared_preferences_macos (0.0.1): + - share_plus (0.0.1): - FlutterMacOS - stack_wallet_backup (0.0.1): - FlutterMacOS @@ -30,16 +82,22 @@ PODS: - FlutterMacOS DEPENDENCIES: - - connectivity_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus_macos/macos`) + - connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`) + - cw_monero (from `Flutter/ephemeral/.symlinks/plugins/cw_monero/macos`) + - cw_shared_external (from `Flutter/ephemeral/.symlinks/plugins/cw_shared_external/macos`) + - cw_wownero (from `Flutter/ephemeral/.symlinks/plugins/cw_wownero/macos`) + - desktop_drop (from `Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos`) + - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) + - devicelocale (from `Flutter/ephemeral/.symlinks/plugins/devicelocale/macos`) - flutter_libepiccash (from `Flutter/ephemeral/.symlinks/plugins/flutter_libepiccash/macos`) - flutter_local_notifications (from `Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos`) - flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`) - FlutterMacOS (from `Flutter/ephemeral`) - isar_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/isar_flutter_libs/macos`) - - package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`) - - path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`) - - share_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos`) - - shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`) + - lelantus (from `Flutter/ephemeral/.symlinks/plugins/lelantus/macos`) + - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) + - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) + - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`) - stack_wallet_backup (from `Flutter/ephemeral/.symlinks/plugins/stack_wallet_backup/macos`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - wakelock_macos (from `Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos`) @@ -50,8 +108,20 @@ SPEC REPOS: - ReachabilitySwift EXTERNAL SOURCES: - connectivity_plus_macos: - :path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus_macos/macos + connectivity_plus: + :path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos + cw_monero: + :path: Flutter/ephemeral/.symlinks/plugins/cw_monero/macos + cw_shared_external: + :path: Flutter/ephemeral/.symlinks/plugins/cw_shared_external/macos + cw_wownero: + :path: Flutter/ephemeral/.symlinks/plugins/cw_wownero/macos + desktop_drop: + :path: Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos + device_info_plus: + :path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos + devicelocale: + :path: Flutter/ephemeral/.symlinks/plugins/devicelocale/macos flutter_libepiccash: :path: Flutter/ephemeral/.symlinks/plugins/flutter_libepiccash/macos flutter_local_notifications: @@ -62,14 +132,14 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral isar_flutter_libs: :path: Flutter/ephemeral/.symlinks/plugins/isar_flutter_libs/macos - package_info_plus_macos: - :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos - path_provider_macos: - :path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos - share_plus_macos: - :path: Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos - shared_preferences_macos: - :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos + lelantus: + :path: Flutter/ephemeral/.symlinks/plugins/lelantus/macos + package_info_plus: + :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos + path_provider_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin + share_plus: + :path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos stack_wallet_backup: :path: Flutter/ephemeral/.symlinks/plugins/stack_wallet_backup/macos url_launcher_macos: @@ -80,22 +150,28 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/window_size/macos SPEC CHECKSUMS: - connectivity_plus_macos: f6e86fd000e971d361e54b5afcadc8c8fa773308 - flutter_libepiccash: b33f7396504712b513b8ff019a3f6f3bdae54cfb + connectivity_plus: 18d3c32514c886e046de60e9c13895109866c747 + cw_monero: a3442556ad3c06365c912735e4a23942a28692b1 + cw_shared_external: 1f631d1132521baac5f4caed43176fa10d4e0d8b + cw_wownero: b4adb1e701fc363de27fa222fcaf4eff6f5fa63a + desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898 + device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f + devicelocale: 9f0f36ac651cabae2c33f32dcff4f32b61c38225 + flutter_libepiccash: 9113ac75dd325f8bcf00bc3ab583c7fc2780cf3c flutter_local_notifications: 3805ca215b2fb7f397d78b66db91f6a747af52e4 - flutter_secure_storage_macos: 6ceee8fbc7f484553ad17f79361b556259df89aa - FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811 - isar_flutter_libs: 1948109973b6c2e46d6196b1537688a36a6edeac - package_info_plus_macos: f010621b07802a241d96d01876d6705f15e77c1c - path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19 + flutter_secure_storage_macos: d56e2d218c1130b262bef8b4a7d64f88d7f9c9ea + FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 + isar_flutter_libs: 43385c99864c168fadba7c9adeddc5d38838ca6a + lelantus: 3dfbf92b1e66b3573494dfe3d6a21c4988b5361b + package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce + path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 - share_plus_macos: 853ee48e7dce06b633998ca0735d482dd671ade4 - shared_preferences_macos: a64dc611287ed6cbe28fd1297898db1336975727 + share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7 stack_wallet_backup: 6ebc60b1bdcf11cf1f1cbad9aa78332e1e15778c - url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3 + url_launcher_macos: 5335912b679c073563f29d89d33d10d459f95451 wakelock_macos: bc3f2a9bd8d2e6c89fee1e1822e7ddac3bd004a9 window_size: 339dafa0b27a95a62a843042038fa6c3c48de195 -PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c +PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367 COCOAPODS: 1.11.3 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 6506a5075..c2c2e62ad 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -21,15 +21,27 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 36299DF6FDF6725B2B9C51D5 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BB87EF657A3ADFB1CE3E959 /* Pods_Runner.framework */; }; + B98151812A674022009D013C /* mobileliblelantus.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B98151802A674022009D013C /* mobileliblelantus.framework */; }; + B98151822A67402A009D013C /* mobileliblelantus.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = B98151802A674022009D013C /* mobileliblelantus.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + B98151842A674143009D013C /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = B98151832A674143009D013C /* libsqlite3.0.tbd */; }; + BFD0376C00E1FFD46376BB9D /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9206484E84CB0AD93E3E68CA /* Pods_RunnerTests.framework */; }; + F653CA022D33E8B60E11A9F3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 33CC10E52044A3C60003C045 /* Project object */; @@ -46,6 +58,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + B98151822A67402A009D013C /* mobileliblelantus.framework in Bundle Framework */, ); name = "Bundle Framework"; runOnlyForDeploymentPostprocessing = 0; @@ -53,9 +66,14 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0FA914E59929120BA65E8403 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 174539D042E7AC2AB25A83EB /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 27CB73AACA5743180CC6CD50 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* Stack Wallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Stack Wallet.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* Stack Wallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Stack Wallet.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -67,26 +85,47 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 6BB87EF657A3ADFB1CE3E959 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 41EE721BF40B8DE895352A2C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 937DF254AD7EDA15AFE96BD9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 9206484E84CB0AD93E3E68CA /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - BC4589C48A71C3A1A477DD76 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - EA2D897BC13EBFB1DE697D5C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + ACB8E553D75AA4AC9A7656CE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + B98151802A674022009D013C /* mobileliblelantus.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mobileliblelantus.framework; path = ../crypto_plugins/flutter_liblelantus/scripts/macos/mobileliblelantus/mobileliblelantus.framework; sourceTree = ""; }; + B98151832A674143009D013C /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; }; + BF5E76865ACB46314AC27D8F /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BFD0376C00E1FFD46376BB9D /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 33CC10EA2044A3C60003C045 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 36299DF6FDF6725B2B9C51D5 /* Pods_Runner.framework in Frameworks */, + B98151842A674143009D013C /* libsqlite3.0.tbd in Frameworks */, + B98151812A674022009D013C /* mobileliblelantus.framework in Frameworks */, + F653CA022D33E8B60E11A9F3 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; 33BA886A226E78AF003329D5 /* Configs */ = { isa = PBXGroup; children = ( @@ -103,9 +142,10 @@ children = ( 33FAB671232836740065AC1E /* Runner */, 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - 9000119722579F22067B9BC0 /* Pods */, + F0D4A0626F78BE1EF2A1E0D6 /* Pods */, ); sourceTree = ""; }; @@ -113,6 +153,7 @@ isa = PBXGroup; children = ( 33CC10ED2044A3C60003C045 /* Stack Wallet.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, ); name = Products; sourceTree = ""; @@ -152,39 +193,63 @@ path = Runner; sourceTree = ""; }; - 9000119722579F22067B9BC0 /* Pods */ = { - isa = PBXGroup; - children = ( - EA2D897BC13EBFB1DE697D5C /* Pods-Runner.debug.xcconfig */, - 937DF254AD7EDA15AFE96BD9 /* Pods-Runner.release.xcconfig */, - BC4589C48A71C3A1A477DD76 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - 6BB87EF657A3ADFB1CE3E959 /* Pods_Runner.framework */, + B98151832A674143009D013C /* libsqlite3.0.tbd */, + B98151802A674022009D013C /* mobileliblelantus.framework */, + E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */, + 9206484E84CB0AD93E3E68CA /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; }; + F0D4A0626F78BE1EF2A1E0D6 /* Pods */ = { + isa = PBXGroup; + children = ( + 41EE721BF40B8DE895352A2C /* Pods-Runner.debug.xcconfig */, + 0FA914E59929120BA65E8403 /* Pods-Runner.release.xcconfig */, + ACB8E553D75AA4AC9A7656CE /* Pods-Runner.profile.xcconfig */, + BF5E76865ACB46314AC27D8F /* Pods-RunnerTests.debug.xcconfig */, + 174539D042E7AC2AB25A83EB /* Pods-RunnerTests.release.xcconfig */, + 27CB73AACA5743180CC6CD50 /* Pods-RunnerTests.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + FF8CC09C83E12FC1C6EE6A8F /* [CP] Check Pods Manifest.lock */, + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 33CC10EC2044A3C60003C045 /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - DF80A3E256A63BF2D2008937 /* [CP] Check Pods Manifest.lock */, + AAFD86C9DC38B4393BC9D8E0 /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 8D7CC24E5AE846869656D4D1 /* [CP] Embed Pods Frameworks */, + 529691D83C3BADE14E2EAC03 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -206,6 +271,10 @@ LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; 33CC10EC2044A3C60003C045 = { CreatedOnToolsVersion = 9.2; LastSwiftMigration = 1100; @@ -236,12 +305,20 @@ projectRoot = ""; targets = ( 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, 33CC111A2044C6BA0003C045 /* Flutter Assemble */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 33CC10EB2044A3C60003C045 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -256,6 +333,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -291,7 +369,7 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 8D7CC24E5AE846869656D4D1 /* [CP] Embed Pods Frameworks */ = { + 529691D83C3BADE14E2EAC03 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -308,7 +386,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - DF80A3E256A63BF2D2008937 /* [CP] Check Pods Manifest.lock */ = { + AAFD86C9DC38B4393BC9D8E0 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -330,9 +408,39 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + FF8CC09C83E12FC1C6EE6A8F /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 33CC10E92044A3C60003C045 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -346,6 +454,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; @@ -366,6 +479,51 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BF5E76865ACB46314AC27D8F /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackWallet.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Stack Wallet.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 174539D042E7AC2AB25A83EB /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackWallet.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Stack Wallet.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 27CB73AACA5743180CC6CD50 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackWallet.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Stack Wallet.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet"; + }; + name = Profile; + }; 338D0CE9231458BD00FA5F75 /* Profile */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; @@ -404,9 +562,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; + STRIP_INSTALLED_PRODUCT = NO; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; }; @@ -421,6 +581,30 @@ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_CONFIGURATION_BUILD_DIR}/ReachabilitySwift\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/connectivity_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/cw_monero\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/cw_shared_external\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/cw_wownero\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/desktop_drop\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/device_info_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_secure_storage_macos\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/isar_flutter_libs\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/lelantus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/package_info_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/path_provider_foundation\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/share_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_macos\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock_macos\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/window_size\"", + "\"${PROJECT_DIR}/../crypto_plugins/flutter_liblelantus/scripts/macos/mobileliblelantus\"", + ); INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -483,10 +667,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; + STRIP_INSTALLED_PRODUCT = NO; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -530,9 +715,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; + STRIP_INSTALLED_PRODUCT = NO; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; }; @@ -547,6 +734,30 @@ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_CONFIGURATION_BUILD_DIR}/ReachabilitySwift\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/connectivity_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/cw_monero\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/cw_shared_external\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/cw_wownero\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/desktop_drop\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/device_info_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_secure_storage_macos\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/isar_flutter_libs\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/lelantus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/package_info_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/path_provider_foundation\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/share_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_macos\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock_macos\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/window_size\"", + "\"${PROJECT_DIR}/../crypto_plugins/flutter_liblelantus/scripts/macos/mobileliblelantus\"", + ); INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -567,6 +778,30 @@ CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_CONFIGURATION_BUILD_DIR}/ReachabilitySwift\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/connectivity_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/cw_monero\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/cw_shared_external\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/cw_wownero\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/desktop_drop\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/device_info_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_secure_storage_macos\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/isar_flutter_libs\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/lelantus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/package_info_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/path_provider_foundation\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/share_plus\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_macos\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock_macos\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/window_size\"", + "\"${PROJECT_DIR}/../crypto_plugins/flutter_liblelantus/scripts/macos/mobileliblelantus\"", + ); INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -596,6 +831,16 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c9216c9be..a9d38bc3b 100644 --- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -37,6 +37,17 @@ + + + + com.apple.security.network.server + com.apple.security.network.client + diff --git a/macos/Runner/MainFlutterWindow.swift b/macos/Runner/MainFlutterWindow.swift index 2722837ec..3cc05eb23 100644 --- a/macos/Runner/MainFlutterWindow.swift +++ b/macos/Runner/MainFlutterWindow.swift @@ -3,7 +3,7 @@ import FlutterMacOS class MainFlutterWindow: NSWindow { override func awakeFromNib() { - let flutterViewController = FlutterViewController.init() + let flutterViewController = FlutterViewController() let windowFrame = self.frame self.contentViewController = flutterViewController self.setFrame(windowFrame, display: true) diff --git a/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements index 852fa1a47..48271acc9 100644 --- a/macos/Runner/Release.entitlements +++ b/macos/Runner/Release.entitlements @@ -4,5 +4,7 @@ com.apple.security.app-sandbox + com.apple.security.network.client + diff --git a/macos/RunnerTests/RunnerTests.swift b/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 000000000..5418c9f53 --- /dev/null +++ b/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import FlutterMacOS +import Cocoa +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/pubspec.lock b/pubspec.lock index 2dcd3c598..e260cb994 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -226,10 +226,10 @@ packages: dependency: transitive description: name: cli_util - sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" + sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7 url: "https://pub.dev" source: hosted - version: "0.3.5" + version: "0.4.0" clock: dependency: transitive description: @@ -584,10 +584,10 @@ packages: dependency: "direct dev" description: name: flutter_launcher_icons - sha256: ce0e501cfc258907842238e4ca605e74b7fd1cdf04b3b43e86c43f3e40a1592c + sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" url: "https://pub.dev" source: hosted - version: "0.11.0" + version: "0.13.1" flutter_libepiccash: dependency: "direct main" description: @@ -646,10 +646,10 @@ packages: dependency: "direct main" description: name: flutter_native_splash - sha256: "6777a3abb974021a39b5fdd2d46a03ca390e03903b6351f21d10e7ecc969f12d" + sha256: ba45d8cfbd778478a74696b012f33ffb6b1760c9bc531b21e2964444a4870dae url: "https://pub.dev" source: hosted - version: "2.2.16" + version: "2.3.1" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -853,10 +853,10 @@ packages: dependency: transitive description: name: image - sha256: "8e9d133755c3e84c73288363e6343157c383a0c6c56fc51afcc5d4d7180306d6" + sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "4.0.17" import_sorter: dependency: "direct dev" description: @@ -948,7 +948,7 @@ packages: path: "crypto_plugins/flutter_liblelantus" relative: true source: path - version: "0.0.1" + version: "0.0.2" lints: dependency: transitive description: @@ -1349,62 +1349,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.1" - shared_preferences: - dependency: transitive - description: - name: shared_preferences - sha256: "16d3fb6b3692ad244a695c0183fca18cf81fd4b821664394a781de42386bf022" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - shared_preferences_android: - dependency: transitive - description: - name: shared_preferences_android - sha256: "6478c6bbbecfe9aced34c483171e90d7c078f5883558b30ec3163cf18402c749" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - shared_preferences_foundation: - dependency: transitive - description: - name: shared_preferences_foundation - sha256: e014107bb79d6d3297196f4f2d0db54b5d1f85b8ea8ff63b8e8b391a02700feb - url: "https://pub.dev" - source: hosted - version: "2.2.2" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - sha256: "9d387433ca65717bbf1be88f4d5bb18f10508917a8fa2fb02e0fd0d7479a9afa" - url: "https://pub.dev" - source: hosted - version: "2.2.0" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - sha256: fb5cf25c0235df2d0640ac1b1174f6466bd311f621574997ac59018a6664548d - url: "https://pub.dev" - source: hosted - version: "2.2.0" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - sha256: "74083203a8eae241e0de4a0d597dbedab3b8fef5563f33cf3c12d7e93c655ca5" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - sha256: "5e588e2efef56916a3b229c3bfe81e6a525665a454519ca51dbcc4236a274173" - url: "https://pub.dev" - source: hosted - version: "2.2.0" shelf: dependency: transitive description: @@ -1631,10 +1575,10 @@ packages: dependency: transitive description: name: universal_io - sha256: "06866290206d196064fd61df4c7aea1ffe9a4e7c4ccaa8fcded42dd41948005d" + sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.2" url_launcher: dependency: "direct main" description: @@ -1887,4 +1831,4 @@ packages: version: "1.0.0" sdks: dart: ">=3.0.2 <4.0.0" - flutter: ">=3.10.0" + flutter: ">=3.10.3" diff --git a/pubspec.yaml b/pubspec.yaml index b214169cf..f5b4cf27b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Stack Wallet # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.7.14+180 +version: 1.7.16+182 environment: sdk: ">=3.0.2 <4.0.0" @@ -108,7 +108,7 @@ dependencies: uuid: ^3.0.5 flutter_rounded_date_picker: ^3.0.1 crypto: ^3.0.2 - barcode_scan2: ^4.2.0 + barcode_scan2: ^4.2.3 wakelock: ^0.6.2 intl: ^0.17.0 devicelocale: ^0.6.0 @@ -145,7 +145,7 @@ dev_dependencies: integration_test: sdk: flutter build_runner: ^2.1.7 - flutter_launcher_icons: ^0.11.0 + flutter_launcher_icons: ^0.13.1 hive_generator: ^2.0.0 dependency_validator: ^3.1.2 hive_test: ^1.0.1 @@ -157,7 +157,7 @@ dev_dependencies: flutter_lints: ^2.0.1 isar_generator: 3.0.5 -flutter_icons: +flutter_launcher_icons: android: true ios: true image_path: assets/icon/icon.png @@ -170,7 +170,7 @@ flutter_icons: icon_size: 48 # min:48, max:256, default: 48 macos: generate: true - image_path: assets/icon/icon.png + image_path: assets/icon/macos-icon.png flutter_native_splash: image: assets/images/splash.png diff --git a/scripts/macos/build_all.sh b/scripts/macos/build_all.sh new file mode 100755 index 000000000..646274593 --- /dev/null +++ b/scripts/macos/build_all.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +(cd ../../crypto_plugins/flutter_liblelantus/scripts/macos && ./build_all.sh ) & +(cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) & +(cd ../../crypto_plugins/flutter_libmonero/scripts/macos/ && ./build_all.sh ) & + +wait +echo "Done building" \ No newline at end of file diff --git a/scripts/setup.sh b/scripts/setup.sh deleted file mode 100755 index 529d2d7ec..000000000 --- a/scripts/setup.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y -mkdir "$HOME/development" -mkdir "$HOME/projects" -sudo apt install -y git build-essential curl -export DEVELOPMENT=$HOME/development -export PROJECTS=$HOME/projects - -# setup flutter -sudo apt install -y unzip pkg-config clang cmake ninja-build libgtk-3-dev -cd $DEVELOPMENT -git clone https://github.com/flutter/flutter.git -cd flutter -git checkout 3.7.12 -export FLUTTER_DIR=$(pwd)/bin -echo 'export PATH="$PATH:'${FLUTTER_DIR}'"' >> ~/.bashrc -source ~/.bashrc -flutter doctor - -# install stack wallet dependencies -sudo apt-get install -y unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake openjdk-8-jre-headless libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm - -sudo apt-get install -y debhelper libclang-dev cargo rustc opencl-headers libssl-dev ocl-icd-opencl-dev - -sudo apt-get install -y unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake openjdk-8-jre-headless - -sudo apt install -y libc6-dev-i386 - -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -source "$HOME/.cargo/env" -cargo install cargo-ndk -rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android - -# # setup stack_wallet github -# cd $PROJECTS -# git clone https://github.com/cypherstack/stack_wallet.git -# cd stack_wallet -# export STACK_WALLET=$(pwd) -# git submodule update --init --recursive - -# # create template lib/external_api_keys.dart file if it doesn't already exist -# KEYS="$HOME/projects/stack_wallet/lib/external_api_keys.dart" -# if ! test -f "$KEYS"; then -# echo 'prebuild.sh: creating template lib/external_api_keys.dart file' -# printf 'const kChangeNowApiKey = "";\nconst kSimpleSwapApiKey = "";' > $KEYS -# fi - -# # build stack wallet plugins -# cd $STACK_WALLET -# cd scripts/android -# ./build_all.sh -# cd ../linux -# ./build_all.sh diff --git a/test/cached_electrumx_test.dart b/test/cached_electrumx_test.dart index f1c3a0c41..1c99fd270 100644 --- a/test/cached_electrumx_test.dart +++ b/test/cached_electrumx_test.dart @@ -1,9 +1,7 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:hive/hive.dart'; import 'package:hive_test/hive_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart'; import 'package:stackwallet/electrumx_rpc/electrumx.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -17,10 +15,10 @@ void main() { group("tests using mock hive", () { setUp(() async { await setUpTestHive(); - await Hive.openBox( - DB.instance.boxNameUsedSerialsCache(coin: Coin.firo)); - await Hive.openBox(DB.instance.boxNameSetCache(coin: Coin.firo)); - await Hive.openBox(DB.instance.boxNameTxCache(coin: Coin.firo)); + // await Hive.openBox( + // DB.instance.boxNameUsedSerialsCache(coin: Coin.firo)); + // await Hive.openBox(DB.instance.boxNameSetCache(coin: Coin.firo)); + // await Hive.openBox(DB.instance.boxNameTxCache(coin: Coin.firo)); }); group("getAnonymitySet", () { // test("empty set cache call", () async { diff --git a/test/hive/db_test.dart b/test/hive/db_test.dart index 2ea60bd52..2f5130837 100644 --- a/test/hive/db_test.dart +++ b/test/hive/db_test.dart @@ -1,12 +1,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:hive_test/hive_test.dart'; import 'package:stackwallet/db/hive/db.dart'; -import 'package:stackwallet/utilities/enums/coin_enum.dart'; void main() { group("DB box names", () { test("address book", () => expect(DB.boxNameAddressBook, "addressBook")); - test("debug info", () => expect(DB.boxNameDebugInfo, "debugInfoBox")); test("nodes", () => expect(DB.boxNameNodeModels, "nodeModels")); test("primary nodes", () => expect(DB.boxNamePrimaryNodes, "primaryNodes")); test("wallets info", () => expect(DB.boxNameAllWalletsData, "wallets")); @@ -33,26 +31,6 @@ void main() { expect(DB.boxNameWalletsToDeleteOnStart, "walletsToDeleteOnStart")); test("price cache", () => expect(DB.boxNamePriceCache, "priceAPIPrice24hCache")); - - test("boxNameTxCache", () { - for (final coin in Coin.values) { - expect(DB.instance.boxNameTxCache(coin: coin), "${coin.name}_txCache"); - } - }); - - test("boxNameSetCache", () { - for (final coin in Coin.values) { - expect(DB.instance.boxNameSetCache(coin: coin), - "${coin.name}_anonymitySetCache"); - } - }); - - test("boxNameUsedSerialsCache", () { - for (final coin in Coin.values) { - expect(DB.instance.boxNameUsedSerialsCache(coin: coin), - "${coin.name}_usedSerialsCache"); - } - }); }); group("tests requiring test hive environment", () { diff --git a/test/notifications/notification_card_test.dart b/test/notifications/notification_card_test.dart index 24c23b35a..55a9dcae5 100644 --- a/test/notifications/notification_card_test.dart +++ b/test/notifications/notification_card_test.dart @@ -23,7 +23,6 @@ void main() { final mockThemeService = MockThemeService(); final theme = StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ); when(mockThemeService.getTheme(themeId: "light")).thenAnswer( diff --git a/test/pages/send_view/send_view_test.dart b/test/pages/send_view/send_view_test.dart index 1747ddc17..975554c8d 100644 --- a/test/pages/send_view/send_view_test.dart +++ b/test/pages/send_view/send_view_test.dart @@ -59,7 +59,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); when(mockPrefs.currency).thenAnswer((_) => "USD"); @@ -89,7 +88,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -143,7 +141,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); @@ -169,7 +166,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/address_book_card_test.dart b/test/widget_tests/address_book_card_test.dart index faf78be2f..1d38e6c95 100644 --- a/test/widget_tests/address_book_card_test.dart +++ b/test/widget_tests/address_book_card_test.dart @@ -56,8 +56,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: - applicationThemesDirectoryPath, ), ), ], diff --git a/test/widget_tests/animated_text_test.dart b/test/widget_tests/animated_text_test.dart index 6401b5822..ff358dfb0 100644 --- a/test/widget_tests/animated_text_test.dart +++ b/test/widget_tests/animated_text_test.dart @@ -28,7 +28,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/custom_buttons/app_bar_icon_button_test.dart b/test/widget_tests/custom_buttons/app_bar_icon_button_test.dart index 0e1902fb5..cdc2ccbef 100644 --- a/test/widget_tests/custom_buttons/app_bar_icon_button_test.dart +++ b/test/widget_tests/custom_buttons/app_bar_icon_button_test.dart @@ -28,7 +28,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/custom_buttons/draggable_switch_button_test.dart b/test/widget_tests/custom_buttons/draggable_switch_button_test.dart index 1c67e2883..2919e05ff 100644 --- a/test/widget_tests/custom_buttons/draggable_switch_button_test.dart +++ b/test/widget_tests/custom_buttons/draggable_switch_button_test.dart @@ -24,7 +24,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -56,7 +55,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -93,7 +91,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/custom_buttons/favorite_toggle_test.dart b/test/widget_tests/custom_buttons/favorite_toggle_test.dart index a7fdc5492..90dbc5546 100644 --- a/test/widget_tests/custom_buttons/favorite_toggle_test.dart +++ b/test/widget_tests/custom_buttons/favorite_toggle_test.dart @@ -22,7 +22,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); @@ -37,7 +36,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/custom_loading_overlay_test.dart b/test/widget_tests/custom_loading_overlay_test.dart index df976eb91..6d0eddb75 100644 --- a/test/widget_tests/custom_loading_overlay_test.dart +++ b/test/widget_tests/custom_loading_overlay_test.dart @@ -22,7 +22,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); @@ -37,7 +36,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/custom_pin_put_test.dart b/test/widget_tests/custom_pin_put_test.dart index 13b2bc892..1b3c1eee3 100644 --- a/test/widget_tests/custom_pin_put_test.dart +++ b/test/widget_tests/custom_pin_put_test.dart @@ -67,7 +67,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -99,7 +98,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -151,7 +149,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -187,7 +184,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -223,7 +219,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -264,7 +259,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -301,7 +295,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -333,7 +326,7 @@ void main() { // StackColors.fromStackColorTheme( // StackTheme.fromJson( // json: lightThemeJsonMap, - // applicationThemesDirectoryPath: "test", + // // ), // ), // ], @@ -385,7 +378,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -427,7 +419,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -469,7 +460,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -510,7 +500,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/desktop/custom_text_button_test.dart b/test/widget_tests/desktop/custom_text_button_test.dart index ab10e2e2d..b1e4054c9 100644 --- a/test/widget_tests/desktop/custom_text_button_test.dart +++ b/test/widget_tests/desktop/custom_text_button_test.dart @@ -17,7 +17,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/desktop/desktop_app_bar_test.dart b/test/widget_tests/desktop/desktop_app_bar_test.dart index eb5ccb7ec..8ddc453ab 100644 --- a/test/widget_tests/desktop/desktop_app_bar_test.dart +++ b/test/widget_tests/desktop/desktop_app_bar_test.dart @@ -19,7 +19,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/desktop/desktop_dialog_close_button_test.dart b/test/widget_tests/desktop/desktop_dialog_close_button_test.dart index 86de83567..ec8b4ce39 100644 --- a/test/widget_tests/desktop/desktop_dialog_close_button_test.dart +++ b/test/widget_tests/desktop/desktop_dialog_close_button_test.dart @@ -24,7 +24,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/desktop/desktop_dialog_test.dart b/test/widget_tests/desktop/desktop_dialog_test.dart index 6ea148e09..5eafb6f8c 100644 --- a/test/widget_tests/desktop/desktop_dialog_test.dart +++ b/test/widget_tests/desktop/desktop_dialog_test.dart @@ -18,7 +18,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/desktop/desktop_scaffold_test.dart b/test/widget_tests/desktop/desktop_scaffold_test.dart index efb41c9a2..8abb4cf5a 100644 --- a/test/widget_tests/desktop/desktop_scaffold_test.dart +++ b/test/widget_tests/desktop/desktop_scaffold_test.dart @@ -21,7 +21,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); await widgetTester.pumpWidget( @@ -35,7 +34,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -57,7 +55,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); @@ -72,7 +69,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -97,7 +93,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); @@ -112,7 +107,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/emoji_select_sheet_test.dart b/test/widget_tests/emoji_select_sheet_test.dart index 4bb6b9046..15be7b153 100644 --- a/test/widget_tests/emoji_select_sheet_test.dart +++ b/test/widget_tests/emoji_select_sheet_test.dart @@ -20,7 +20,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -49,7 +48,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/icon_widgets/addressbook_icon_test.dart b/test/widget_tests/icon_widgets/addressbook_icon_test.dart index 48b7925d4..ad8470898 100644 --- a/test/widget_tests/icon_widgets/addressbook_icon_test.dart +++ b/test/widget_tests/icon_widgets/addressbook_icon_test.dart @@ -21,7 +21,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/managed_favorite_test.dart b/test/widget_tests/managed_favorite_test.dart index e0cb0dfc7..3d8bb66fa 100644 --- a/test/widget_tests/managed_favorite_test.dart +++ b/test/widget_tests/managed_favorite_test.dart @@ -55,7 +55,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); when(wallet.coin).thenAnswer((_) => Coin.bitcoin); @@ -97,7 +96,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -126,7 +124,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); when(wallet.coin).thenAnswer((_) => Coin.bitcoin); @@ -186,7 +183,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -214,7 +210,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); when(wallet.coin).thenAnswer((_) => Coin.bitcoin); @@ -274,7 +269,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/node_card_test.dart b/test/widget_tests/node_card_test.dart index cf7be76af..b8e126696 100644 --- a/test/widget_tests/node_card_test.dart +++ b/test/widget_tests/node_card_test.dart @@ -57,7 +57,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -118,7 +117,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -180,7 +178,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/node_options_sheet_test.dart b/test/widget_tests/node_options_sheet_test.dart index c1aacbb51..b80e4682d 100644 --- a/test/widget_tests/node_options_sheet_test.dart +++ b/test/widget_tests/node_options_sheet_test.dart @@ -63,7 +63,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -136,7 +135,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -203,7 +201,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/progress_bar_test.dart b/test/widget_tests/progress_bar_test.dart index f375e7392..681a5ac0c 100644 --- a/test/widget_tests/progress_bar_test.dart +++ b/test/widget_tests/progress_bar_test.dart @@ -10,7 +10,6 @@ void main() { testWidgets("Widget build", (widgetTester) async { final theme = StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ); await widgetTester.pumpWidget( MaterialApp( diff --git a/test/widget_tests/shake/shake_test.dart b/test/widget_tests/shake/shake_test.dart index e699a2fca..ab9a80fed 100644 --- a/test/widget_tests/shake/shake_test.dart +++ b/test/widget_tests/shake/shake_test.dart @@ -15,23 +15,23 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], ), home: Material( child: Shake( - animationRange: 10, - controller: ShakeController(), - animationDuration: const Duration(milliseconds: 200), - child: Column( - children: const [ - Center( - child: Text("Enter Pin"), - ) - ], - )), + animationRange: 10, + controller: ShakeController(), + animationDuration: const Duration(milliseconds: 200), + child: const Column( + children: [ + Center( + child: Text("Enter Pin"), + ) + ], + ), + ), ), ), ); diff --git a/test/widget_tests/stack_dialog_test.dart b/test/widget_tests/stack_dialog_test.dart index 3397e3c9e..0f42ab80a 100644 --- a/test/widget_tests/stack_dialog_test.dart +++ b/test/widget_tests/stack_dialog_test.dart @@ -17,7 +17,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -39,7 +38,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -75,7 +73,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/table_view/table_view_cell_test.dart b/test/widget_tests/table_view/table_view_cell_test.dart index 228a7c2e9..14e66eb5e 100644 --- a/test/widget_tests/table_view/table_view_cell_test.dart +++ b/test/widget_tests/table_view/table_view_cell_test.dart @@ -16,7 +16,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/table_view/table_view_row_test.dart b/test/widget_tests/table_view/table_view_row_test.dart index 676d18f3b..4a84f0e64 100644 --- a/test/widget_tests/table_view/table_view_row_test.dart +++ b/test/widget_tests/table_view/table_view_row_test.dart @@ -42,7 +42,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); @@ -80,7 +79,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/table_view/table_view_test.dart b/test/widget_tests/table_view/table_view_test.dart index a52986985..67813ec5f 100644 --- a/test/widget_tests/table_view/table_view_test.dart +++ b/test/widget_tests/table_view/table_view_test.dart @@ -17,7 +17,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/textfield_icon_button_test.dart b/test/widget_tests/textfield_icon_button_test.dart index 43be6ce11..8ce9400cd 100644 --- a/test/widget_tests/textfield_icon_button_test.dart +++ b/test/widget_tests/textfield_icon_button_test.dart @@ -16,7 +16,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/trade_card_test.dart b/test/widget_tests/trade_card_test.dart index 6e5a81288..d42c00b85 100644 --- a/test/widget_tests/trade_card_test.dart +++ b/test/widget_tests/trade_card_test.dart @@ -21,7 +21,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); final trade = Trade( @@ -59,7 +58,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test/sample_data", ), ), ], diff --git a/test/widget_tests/transaction_card_test.dart b/test/widget_tests/transaction_card_test.dart index 3a9765720..c4b89fb4a 100644 --- a/test/widget_tests/transaction_card_test.dart +++ b/test/widget_tests/transaction_card_test.dart @@ -93,7 +93,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); when(wallet.coin.ticker).thenAnswer((_) => "FIRO"); @@ -138,7 +137,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -224,7 +222,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); when(wallet.coin.ticker).thenAnswer((_) => "FIRO"); @@ -268,7 +265,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -352,7 +348,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); when(wallet.coin.ticker).thenAnswer((_) => "FIRO"); @@ -397,7 +392,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], @@ -474,7 +468,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); when(wallet.coin.ticker).thenAnswer((_) => "FIRO"); @@ -524,7 +517,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/wallet_card_test.dart b/test/widget_tests/wallet_card_test.dart index 8598b382e..c2e77d012 100644 --- a/test/widget_tests/wallet_card_test.dart +++ b/test/widget_tests/wallet_card_test.dart @@ -42,7 +42,6 @@ void main() { mockito.when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); mockito.when(wallet.walletId).thenAnswer((realInvocation) => "wallet id"); @@ -81,7 +80,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.dart b/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.dart index 1368e8277..fee5ab6d5 100644 --- a/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.dart +++ b/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.dart @@ -64,7 +64,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ], diff --git a/test/widget_tests/wallet_info_row/wallet_info_row_test.dart b/test/widget_tests/wallet_info_row/wallet_info_row_test.dart index ba669e8c0..c3fb2eef5 100644 --- a/test/widget_tests/wallet_info_row/wallet_info_row_test.dart +++ b/test/widget_tests/wallet_info_row/wallet_info_row_test.dart @@ -41,7 +41,6 @@ void main() { when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ); when(wallet.coin).thenAnswer((_) => Coin.bitcoin); @@ -73,7 +72,6 @@ void main() { StackColors.fromStackColorTheme( StackTheme.fromJson( json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", ), ), ],