diff --git a/cw_monero/lib/monero_subaddress_list.dart b/cw_monero/lib/monero_subaddress_list.dart index dbd1a89ae..09807e7cd 100644 --- a/cw_monero/lib/monero_subaddress_list.dart +++ b/cw_monero/lib/monero_subaddress_list.dart @@ -23,7 +23,7 @@ abstract class MoneroSubaddressListBase with Store { bool _isUpdating; void update({required int accountIndex}) { - refreshCoins(accountIndex); + // refreshCoins(accountIndex); if (_isUpdating) { return; diff --git a/cw_monero/lib/monero_wallet.dart b/cw_monero/lib/monero_wallet.dart index 9f939ed0c..d717a6083 100644 --- a/cw_monero/lib/monero_wallet.dart +++ b/cw_monero/lib/monero_wallet.dart @@ -405,7 +405,7 @@ abstract class MoneroWalletBase extends WalletBase updateUnspent() async { - refreshCoins(walletAddresses.account!.id); + // refreshCoins(walletAddresses.account!.id); unspentCoins.clear(); diff --git a/cw_monero/lib/monero_wallet_service.dart b/cw_monero/lib/monero_wallet_service.dart index 8e7fd96e3..0fe6e77f6 100644 --- a/cw_monero/lib/monero_wallet_service.dart +++ b/cw_monero/lib/monero_wallet_service.dart @@ -178,7 +178,7 @@ class MoneroWalletService extends WalletService< final currentWalletInfo = walletInfoSource.values.firstWhere( (info) => info.id == WalletBase.idFor(currentName, getType())); final currentWallet = - MoneroWallet(walletInfo: currentWalletInfo, unspentCoinsInfo: unspentCoinsInfoSource); + MoneroWallet(walletInfo: currentWalletInfo, unspentCoinsInfo: unspentCoinsInfoSource, password: password); await currentWallet.renameWalletFiles(newName); diff --git a/lib/reactions/on_wallet_sync_status_change.dart b/lib/reactions/on_wallet_sync_status_change.dart index 767bfd7e8..96305de04 100644 --- a/lib/reactions/on_wallet_sync_status_change.dart +++ b/lib/reactions/on_wallet_sync_status_change.dart @@ -7,17 +7,15 @@ import 'package:cw_core/wallet_base.dart'; import 'package:cw_core/balance.dart'; import 'package:cw_core/transaction_info.dart'; import 'package:cw_core/sync_status.dart'; -import 'package:wakelock/wakelock.dart'; +import 'package:wakelock_plus/wakelock_plus.dart'; ReactionDisposer? _onWalletSyncStatusChangeReaction; void startWalletSyncStatusChangeReaction( - WalletBase, - TransactionInfo> wallet, + WalletBase, TransactionInfo> wallet, FiatConversionStore fiatConversionStore) { _onWalletSyncStatusChangeReaction?.reaction.dispose(); - _onWalletSyncStatusChangeReaction = - reaction((_) => wallet.syncStatus, (SyncStatus status) async { + _onWalletSyncStatusChangeReaction = reaction((_) => wallet.syncStatus, (SyncStatus status) async { try { if (status is ConnectedSyncStatus) { await wallet.startSync(); @@ -27,12 +25,12 @@ void startWalletSyncStatusChangeReaction( } } if (status is SyncingSyncStatus) { - await Wakelock.enable(); + await WakelockPlus.enable(); } if (status is SyncedSyncStatus || status is FailedSyncStatus) { - await Wakelock.disable(); + await WakelockPlus.disable(); } - } catch(e) { + } catch (e) { print(e.toString()); } }); diff --git a/lib/src/screens/dashboard/desktop_widgets/desktop_action_button.dart b/lib/src/screens/dashboard/desktop_widgets/desktop_action_button.dart index ff83f3adb..f49047e0b 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_action_button.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_action_button.dart @@ -2,6 +2,9 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; import 'package:flutter/material.dart'; class DesktopActionButton extends StatelessWidget { diff --git a/lib/src/screens/dashboard/widgets/address_page.dart b/lib/src/screens/dashboard/widgets/address_page.dart index 8bd882a5f..ca253e2a6 100644 --- a/lib/src/screens/dashboard/widgets/address_page.dart +++ b/lib/src/screens/dashboard/widgets/address_page.dart @@ -8,9 +8,12 @@ import 'package:cake_wallet/entities/receive_page_option.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/present_receive_option_picker.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/src/widgets/gradient_background.dart'; +import 'package:cake_wallet/src/widgets/gradient_background.dart'; import 'package:cake_wallet/src/widgets/keyboard_done_button.dart'; import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cake_wallet/utils/share_util.dart'; diff --git a/lib/src/screens/dashboard/widgets/balance_page.dart b/lib/src/screens/dashboard/widgets/balance_page.dart index c8d7faf11..23a2d6d88 100644 --- a/lib/src/screens/dashboard/widgets/balance_page.dart +++ b/lib/src/screens/dashboard/widgets/balance_page.dart @@ -2,6 +2,7 @@ import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/exchange_trade/information_page.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; import 'package:cake_wallet/utils/feature_flag.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:flutter/material.dart'; @@ -12,6 +13,8 @@ import 'package:cake_wallet/src/widgets/introducing_card.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; class BalancePage extends StatelessWidget { BalancePage({required this.dashboardViewModel, required this.settingsStore}); diff --git a/lib/src/screens/new_wallet/new_wallet_page.dart b/lib/src/screens/new_wallet/new_wallet_page.dart index fbc405177..cc614453e 100644 --- a/lib/src/screens/new_wallet/new_wallet_page.dart +++ b/lib/src/screens/new_wallet/new_wallet_page.dart @@ -180,26 +180,20 @@ class _WalletNameFormState extends State { style: TextStyle( fontSize: 20.0, fontWeight: FontWeight.w600, - color: Theme.of(context).primaryTextTheme!.headline6!.color!), + color: Theme.of(context).extension()!.titleColor), decoration: InputDecoration( hintStyle: TextStyle( fontSize: 18.0, fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme!.headline2!.color!), + color: Theme.of(context).extension()!.hintTextColor), hintText: S.of(context).password, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: Theme.of(context) - .accentTextTheme! - .headline2! - .decorationColor!, + color: Theme.of(context).extension()!.underlineColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: Theme.of(context) - .accentTextTheme! - .headline2! - .decorationColor!, + color: Theme.of(context).extension()!.underlineColor, width: 1.0), ) ) @@ -212,26 +206,20 @@ class _WalletNameFormState extends State { style: TextStyle( fontSize: 20.0, fontWeight: FontWeight.w600, - color: Theme.of(context).primaryTextTheme!.headline6!.color!), + color: Theme.of(context).extension()!.titleColor), decoration: InputDecoration( hintStyle: TextStyle( fontSize: 18.0, fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme!.headline2!.color!), + color: Theme.of(context).extension()!.hintTextColor), hintText: S.of(context).repeate_wallet_password, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: Theme.of(context) - .accentTextTheme! - .headline2! - .decorationColor!, + color: Theme.of(context).extension()!.underlineColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: Theme.of(context) - .accentTextTheme! - .headline2! - .decorationColor!, + color: Theme.of(context).extension()!.underlineColor, width: 1.0), ) ) diff --git a/lib/src/screens/restore/wallet_restore_from_keys_form.dart b/lib/src/screens/restore/wallet_restore_from_keys_form.dart index bb47790b7..373955767 100644 --- a/lib/src/screens/restore/wallet_restore_from_keys_form.dart +++ b/lib/src/screens/restore/wallet_restore_from_keys_form.dart @@ -69,7 +69,6 @@ class WalletRestoreFromKeysFromState extends State { repeatedPasswordListener = () => widget.onRepeatedPasswordChange?.call(repeatedPasswordTextEditingController!.text); repeatedPasswordTextEditingController?.addListener(repeatedPasswordListener!); } - super.initState(); privateKeyController.addListener(() { diff --git a/lib/src/screens/settings/security_backup_page.dart b/lib/src/screens/settings/security_backup_page.dart index 5e191b8a6..13ec50db1 100644 --- a/lib/src/screens/settings/security_backup_page.dart +++ b/lib/src/screens/settings/security_backup_page.dart @@ -41,17 +41,18 @@ class SecurityBackupPage extends BasePage { ), ), StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)), - if (!SettingsStoreBase.walletPasswordDirectInput) - ...[SettingsCellWithArrow( - title: S.current.create_backup, - handler: (_) => _authService.authenticateAction( - context, - route: Routes.backup, - conditionToDetermineIfToUse2FA: _securitySettingsViewModel - .shouldRequireTOTP2FAForAllSecurityAndBackupSettings, + if (!SettingsStoreBase.walletPasswordDirectInput) ...[ + SettingsCellWithArrow( + title: S.current.create_backup, + handler: (_) => _authService.authenticateAction( + context, + route: Routes.backup, + conditionToDetermineIfToUse2FA: + _securitySettingsViewModel.shouldRequireTOTP2FAForAllSecurityAndBackupSettings, + ), ), - ), - StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24))], + StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)), + ], SettingsCellWithArrow( title: S.current.settings_change_pin, handler: (_) => _authService.authenticateAction( diff --git a/lib/src/screens/support/support_page.dart b/lib/src/screens/support/support_page.dart index b385530fb..f13bcd1d5 100644 --- a/lib/src/screens/support/support_page.dart +++ b/lib/src/screens/support/support_page.dart @@ -1,7 +1,7 @@ import 'package:cake_wallet/src/screens/settings/widgets/settings_cell_with_arrow.dart'; import 'package:cake_wallet/src/screens/settings/widgets/settings_link_provider_cell.dart'; import 'package:cake_wallet/src/widgets/standard_list.dart'; -import 'package:cake_wallet/utils/responsive_layout_util.dart'; +import 'package:cake_wallet/themes/extensions/support_page_theme.dart'; import 'package:cake_wallet/view_model/settings/link_list_item.dart'; import 'package:cake_wallet/view_model/settings/regular_list_item.dart'; import 'package:cake_wallet/view_model/support_view_model.dart'; @@ -19,19 +19,15 @@ class SupportPage extends BasePage { @override Widget body(BuildContext context) { - final iconColor = Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!; + final iconColor = Theme.of(context).extension()!.iconColor; // FIX-ME: Added `context` it was not used here before, maby bug ? return Center( child: ConstrainedBox( constraints: BoxConstraints(maxWidth: 500), child: SectionStandardList( - context: context, sectionCount: 1, itemCounter: (int _) => supportViewModel.items.length, - itemBuilder: (_, __, index) { + itemBuilder: (_, index) { final item = supportViewModel.items[index]; if (item is RegularListItem) { diff --git a/lib/src/screens/wallet_list/wallet_list_page.dart b/lib/src/screens/wallet_list/wallet_list_page.dart index 75f1ecc14..d79b6ca98 100644 --- a/lib/src/screens/wallet_list/wallet_list_page.dart +++ b/lib/src/screens/wallet_list/wallet_list_page.dart @@ -1,3 +1,6 @@ +import 'package:cake_wallet/src/screens/auth/auth_page.dart'; +import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_arguments.dart'; +import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/main.dart'; import 'package:cake_wallet/src/screens/auth/auth_page.dart'; diff --git a/lib/src/screens/wallet_unlock/wallet_unlock_page.dart b/lib/src/screens/wallet_unlock/wallet_unlock_page.dart index 9c66871d9..a5421766c 100644 --- a/lib/src/screens/wallet_unlock/wallet_unlock_page.dart +++ b/lib/src/screens/wallet_unlock/wallet_unlock_page.dart @@ -2,11 +2,13 @@ import 'package:another_flushbar/flushbar.dart'; import 'package:cake_wallet/core/execution_state.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/screens/auth/auth_page.dart'; +import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_arguments.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cake_wallet/utils/show_bar.dart'; -import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_arguments.dart'; -import 'package:cake_wallet/view_model/wallet_unlock_verifiable_view_model.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/view_model/wallet_unlock_view_model.dart'; @@ -168,7 +170,7 @@ class WalletUnlockPageState extends AuthPageState { style: TextStyle( fontSize: 24, fontWeight: FontWeight.w500, - color: Theme.of(context).primaryTextTheme.titleLarge!.color!)), + color: Theme.of(context).extension()!.titleColor)), SizedBox(height: 24), Form( child: TextFormField( @@ -179,26 +181,20 @@ class WalletUnlockPageState extends AuthPageState { style: TextStyle( fontSize: 20.0, fontWeight: FontWeight.w600, - color: Theme.of(context).primaryTextTheme.titleLarge!.color!), + color: Theme.of(context).extension()!.titleColor), decoration: InputDecoration( hintStyle: TextStyle( fontSize: 18.0, fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme.displayMedium!.color!), + color: Theme.of(context).extension()!.hintTextColor), hintText: S.of(context).enter_wallet_password, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: Theme.of(context) - .accentTextTheme - .displayMedium! - .decorationColor!, + color: Theme.of(context).extension()!.underlineColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: Theme.of(context) - .accentTextTheme - .displayMedium! - .decorationColor!, + color: Theme.of(context).extension()!.underlineColor, width: 1.0), ) )))])), diff --git a/lib/store/settings_store.dart b/lib/store/settings_store.dart index 9d5a3f3e5..cb2eea111 100644 --- a/lib/store/settings_store.dart +++ b/lib/store/settings_store.dart @@ -618,7 +618,7 @@ abstract class SettingsStoreBase with Store { final generateSubaddresses = sharedPreferences.getInt(PreferencesKey.autoGenerateSubaddressStatusKey); var appVersion = ''; - + try { final packageInfo = await PackageInfo.fromPlatform(); appVersion = packageInfo.version; diff --git a/lib/view_model/support_view_model.dart b/lib/view_model/support_view_model.dart index 386ebfc50..3b707e749 100644 --- a/lib/view_model/support_view_model.dart +++ b/lib/view_model/support_view_model.dart @@ -7,6 +7,7 @@ import 'package:flutter/material.dart'; import 'package:mobx/mobx.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:cake_wallet/wallet_type_utils.dart'; +import 'package:cake_wallet/.secrets.g.dart' as secrets; part 'support_view_model.g.dart'; @@ -19,7 +20,7 @@ abstract class SupportViewModelBase with Store { title: S.current.faq, handler: (BuildContext context) async { try { - await launch(url); + await launchUrl(url); } catch (e) {} }, ), @@ -87,6 +88,8 @@ abstract class SupportViewModelBase with Store { final guidesUrl = 'https://guides.cakewallet.com'; + static final url = Uri(scheme: "https", host: "guides.cakewallet.com"); + String fetchUrl({String locale = "en", String authToken = ""}) { var supportUrl = "https://app.chatwoot.com/widget?website_token=${secrets.chatwootWebsiteToken}&locale=${locale}"; diff --git a/pubspec_base.yaml b/pubspec_base.yaml index 2a799c7a1..0216658be 100644 --- a/pubspec_base.yaml +++ b/pubspec_base.yaml @@ -29,7 +29,7 @@ dependencies: hive_flutter: ^1.1.0 local_auth: ^2.1.0 local_auth_android: 1.0.21 - package_info_plus: ^3.1.0 + package_info_plus: ^4.1.0 devicelocale: git: url: https://github.com/cake-tech/flutter-devicelocale @@ -60,7 +60,7 @@ dependencies: device_display_brightness: ^0.0.6 workmanager: ^0.5.1 platform_device_id: ^1.0.1 - wakelock: ^0.6.2 + wakelock_plus: ^1.1.1 flutter_mailer: ^2.0.2 device_info_plus: 8.1.0 base32: 2.1.3 diff --git a/tool/configure.dart b/tool/configure.dart index 1154358b1..b6e455d5f 100644 --- a/tool/configure.dart +++ b/tool/configure.dart @@ -497,8 +497,7 @@ import 'package:cw_ethereum/ethereum_transaction_priority.dart'; abstract class Ethereum { List getEthereumWordList(String language); WalletService createEthereumWalletService(Box walletInfoSource, bool isDirect); - WalletCredentials createEthereumNewWalletCredentials({ - required String name, WalletInfo? walletInfo, String? password}); + WalletCredentials createEthereumNewWalletCredentials({required String name, WalletInfo? walletInfo, String? password}); WalletCredentials createEthereumRestoreWalletFromSeedCredentials({required String name, required String mnemonic, required String password}); WalletCredentials createEthereumRestoreWalletFromPrivateKey({required String name, required String privateKey, required String password}); String getAddress(WalletBase wallet); @@ -554,7 +553,6 @@ Future generatePubspec({ required bool hasBitcoin, required bool hasHaven, required bool hasEthereum, - required bool hasFlutterSecureStorage, required bool hasFlutterSecureStorage}) async { const cwCore = """ cw_core: @@ -613,7 +611,7 @@ Future generatePubspec({ } if (hasFlutterSecureStorage) { - output += '\n$flutterSecureStorage\n'; + output += '\n$flutterSecureStorage\n'; } final outputLines = output.split('\n'); @@ -731,4 +729,4 @@ class FakeSecureStorage extends SecureStorage { } await outputFile.writeAsString(output); -} \ No newline at end of file +}