diff --git a/assets/images/2fa.png b/assets/images/2fa.png new file mode 100644 index 000000000..36c99beab Binary files /dev/null and b/assets/images/2fa.png differ diff --git a/assets/images/2fa_warning_dark.svg b/assets/images/2fa_warning_dark.svg new file mode 100644 index 000000000..c9fcad341 --- /dev/null +++ b/assets/images/2fa_warning_dark.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/2fa_warning_light.svg b/assets/images/2fa_warning_light.svg new file mode 100644 index 000000000..087d8e99b --- /dev/null +++ b/assets/images/2fa_warning_light.svg @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/birthday_cake.png b/assets/images/birthday_cake.png index 84b084fba..293cd10f6 100644 Binary files a/assets/images/birthday_cake.png and b/assets/images/birthday_cake.png differ diff --git a/assets/images/birthday_cake.svg b/assets/images/birthday_cake.svg deleted file mode 100644 index b5e31dddb..000000000 --- a/assets/images/birthday_cake.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/btc_lock_dark.png b/assets/images/btc_lock_dark.png new file mode 100644 index 000000000..f5b3d7e27 Binary files /dev/null and b/assets/images/btc_lock_dark.png differ diff --git a/assets/images/btc_lock_light.png b/assets/images/btc_lock_light.png new file mode 100644 index 000000000..4320d96e3 Binary files /dev/null and b/assets/images/btc_lock_light.png differ diff --git a/assets/images/buy.png b/assets/images/buy.png index ff4549d5a..32c116e6b 100644 Binary files a/assets/images/buy.png and b/assets/images/buy.png differ diff --git a/assets/images/cake_logo_dark.svg b/assets/images/cake_logo_dark.svg new file mode 100644 index 000000000..095077443 --- /dev/null +++ b/assets/images/cake_logo_dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/cake_logo_light.svg b/assets/images/cake_logo_light.svg new file mode 100644 index 000000000..767e205d1 --- /dev/null +++ b/assets/images/cake_logo_light.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/contact.png b/assets/images/contact.png new file mode 100644 index 000000000..5cf96694b Binary files /dev/null and b/assets/images/contact.png differ diff --git a/assets/images/hero/cw_welcome_dark.svg b/assets/images/hero/cw_welcome_dark.svg new file mode 100644 index 000000000..5479cb1ee --- /dev/null +++ b/assets/images/hero/cw_welcome_dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/hero/cw_welcome_light.svg b/assets/images/hero/cw_welcome_light.svg new file mode 100644 index 000000000..ece7d1f84 --- /dev/null +++ b/assets/images/hero/cw_welcome_light.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/home_screen_setting_icon.svg b/assets/images/home_screen_setting_icon.svg new file mode 100644 index 000000000..7b3aa7b4c --- /dev/null +++ b/assets/images/home_screen_setting_icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/menu.svg b/assets/images/menu.svg new file mode 100644 index 000000000..0a4cc3784 --- /dev/null +++ b/assets/images/menu.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/notification_icon.svg b/assets/images/notification_icon.svg index 099039e67..360d0b4e6 100644 --- a/assets/images/notification_icon.svg +++ b/assets/images/notification_icon.svg @@ -1,69 +1,3 @@ - - - -image/svg+xml \ No newline at end of file + + + diff --git a/assets/images/passphrase_dark.png b/assets/images/passphrase_dark.png new file mode 100644 index 000000000..f72d1e1a1 Binary files /dev/null and b/assets/images/passphrase_dark.png differ diff --git a/assets/images/passphrase_light.png b/assets/images/passphrase_light.png new file mode 100644 index 000000000..f86f68156 Binary files /dev/null and b/assets/images/passphrase_light.png differ diff --git a/assets/images/receive.png b/assets/images/receive.png new file mode 100644 index 000000000..180a4e5b3 Binary files /dev/null and b/assets/images/receive.png differ diff --git a/assets/images/seed_verified_dark.png b/assets/images/seed_verified_dark.png new file mode 100644 index 000000000..cbefa5d8c Binary files /dev/null and b/assets/images/seed_verified_dark.png differ diff --git a/assets/images/seed_verified_light.png b/assets/images/seed_verified_light.png new file mode 100644 index 000000000..a51eddcd7 Binary files /dev/null and b/assets/images/seed_verified_light.png differ diff --git a/assets/images/seed_warning_dark.svg b/assets/images/seed_warning_dark.svg new file mode 100644 index 000000000..0a47254ff --- /dev/null +++ b/assets/images/seed_warning_dark.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/seed_warning_light.svg b/assets/images/seed_warning_light.svg new file mode 100644 index 000000000..cab27ec31 --- /dev/null +++ b/assets/images/seed_warning_light.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/send.png b/assets/images/send.png deleted file mode 100644 index aef504999..000000000 Binary files a/assets/images/send.png and /dev/null differ diff --git a/assets/images/send2.png b/assets/images/send2.png new file mode 100644 index 000000000..85fc570a8 Binary files /dev/null and b/assets/images/send2.png differ diff --git a/assets/images/swap.png b/assets/images/swap.png new file mode 100644 index 000000000..fe3fc0893 Binary files /dev/null and b/assets/images/swap.png differ diff --git a/assets/images/wallet_group_bright.png b/assets/images/wallet_group_bright.png deleted file mode 100644 index 263361db6..000000000 Binary files a/assets/images/wallet_group_bright.png and /dev/null differ diff --git a/assets/images/wallet_group_confirmed_dark.png b/assets/images/wallet_group_confirmed_dark.png new file mode 100644 index 000000000..a047cb29c Binary files /dev/null and b/assets/images/wallet_group_confirmed_dark.png differ diff --git a/assets/images/wallet_group_confirmed_light.png b/assets/images/wallet_group_confirmed_light.png new file mode 100644 index 000000000..851d32300 Binary files /dev/null and b/assets/images/wallet_group_confirmed_light.png differ diff --git a/assets/images/wallet_group_dark.png b/assets/images/wallet_group_dark.png deleted file mode 100644 index 7cd08d2cd..000000000 Binary files a/assets/images/wallet_group_dark.png and /dev/null differ diff --git a/assets/images/wallet_group_empty_dark.png b/assets/images/wallet_group_empty_dark.png new file mode 100644 index 000000000..e613d876e Binary files /dev/null and b/assets/images/wallet_group_empty_dark.png differ diff --git a/assets/images/wallet_group_empty_light.png b/assets/images/wallet_group_empty_light.png new file mode 100644 index 000000000..f795648ae Binary files /dev/null and b/assets/images/wallet_group_empty_light.png differ diff --git a/assets/images/wallet_group_light.png b/assets/images/wallet_group_light.png deleted file mode 100644 index 7827971e7..000000000 Binary files a/assets/images/wallet_group_light.png and /dev/null differ diff --git a/assets/images/wallet_group_options_dark.png b/assets/images/wallet_group_options_dark.png new file mode 100644 index 000000000..479aac57c Binary files /dev/null and b/assets/images/wallet_group_options_dark.png differ diff --git a/assets/images/wallet_group_options_light.png b/assets/images/wallet_group_options_light.png new file mode 100644 index 000000000..308930520 Binary files /dev/null and b/assets/images/wallet_group_options_light.png differ diff --git a/assets/images/wallet_name.png b/assets/images/wallet_name.png deleted file mode 100644 index f586682bd..000000000 Binary files a/assets/images/wallet_name.png and /dev/null differ diff --git a/assets/images/wallet_name_light.png b/assets/images/wallet_name_light.png deleted file mode 100644 index 0199c1b30..000000000 Binary files a/assets/images/wallet_name_light.png and /dev/null differ diff --git a/assets/images/wallet_type.png b/assets/images/wallet_type.png deleted file mode 100644 index 4e0eba8b5..000000000 Binary files a/assets/images/wallet_type.png and /dev/null differ diff --git a/assets/images/wallet_type_light.png b/assets/images/wallet_type_light.png deleted file mode 100644 index e36c0d3aa..000000000 Binary files a/assets/images/wallet_type_light.png and /dev/null differ diff --git a/assets/images/wallet_type_wallet_dark.png b/assets/images/wallet_type_wallet_dark.png new file mode 100644 index 000000000..b840f5547 Binary files /dev/null and b/assets/images/wallet_type_wallet_dark.png differ diff --git a/assets/images/wallet_type_wallet_light.png b/assets/images/wallet_type_wallet_light.png new file mode 100644 index 000000000..ee759a109 Binary files /dev/null and b/assets/images/wallet_type_wallet_light.png differ diff --git a/assets/images/wallets.png b/assets/images/wallets.png new file mode 100644 index 000000000..62ea20039 Binary files /dev/null and b/assets/images/wallets.png differ diff --git a/assets/images/welcome.png b/assets/images/welcome.png deleted file mode 100644 index f1132d253..000000000 Binary files a/assets/images/welcome.png and /dev/null differ diff --git a/assets/images/welcome_dark_theme.svg b/assets/images/welcome_dark_theme.svg new file mode 100644 index 000000000..8f60c931a --- /dev/null +++ b/assets/images/welcome_dark_theme.svg @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/welcome_light.png b/assets/images/welcome_light.png deleted file mode 100644 index 6feff85d1..000000000 Binary files a/assets/images/welcome_light.png and /dev/null differ diff --git a/assets/images/welcome_light_theme.svg b/assets/images/welcome_light_theme.svg new file mode 100644 index 000000000..178b2853d --- /dev/null +++ b/assets/images/welcome_light_theme.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/images/welcome_wallet_dark.png b/assets/images/welcome_wallet_dark.png new file mode 100644 index 000000000..771a600d3 Binary files /dev/null and b/assets/images/welcome_wallet_dark.png differ diff --git a/assets/images/welcome_wallet_light.png b/assets/images/welcome_wallet_light.png new file mode 100644 index 000000000..2a738be0b Binary files /dev/null and b/assets/images/welcome_wallet_light.png differ diff --git a/assets/images/wyre-icon.png b/assets/images/wyre-icon.png deleted file mode 100644 index a2810948e..000000000 Binary files a/assets/images/wyre-icon.png and /dev/null differ diff --git a/assets/images/wyre.png b/assets/images/wyre.png deleted file mode 100644 index a16bbdc8b..000000000 Binary files a/assets/images/wyre.png and /dev/null differ diff --git a/assets/images/yat_crypto.png b/assets/images/yat_crypto.png deleted file mode 100644 index fbd5d2483..000000000 Binary files a/assets/images/yat_crypto.png and /dev/null differ diff --git a/integration_test/robots/new_wallet_type_page_robot.dart b/integration_test/robots/new_wallet_type_page_robot.dart index 89fc8d390..eb1a1900a 100644 --- a/integration_test/robots/new_wallet_type_page_robot.dart +++ b/integration_test/robots/new_wallet_type_page_robot.dart @@ -1,6 +1,6 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/screens/new_wallet/new_wallet_type_page.dart'; -import 'package:cake_wallet/themes/theme_base.dart'; +import 'package:cake_wallet/themes/core/material_base_theme.dart'; import 'package:cw_core/wallet_type.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/lib/buy/moonpay/moonpay_provider.dart b/lib/buy/moonpay/moonpay_provider.dart index 1cfef7202..47e8e34f9 100644 --- a/lib/buy/moonpay/moonpay_provider.dart +++ b/lib/buy/moonpay/moonpay_provider.dart @@ -14,8 +14,8 @@ import 'package:cake_wallet/exchange/trade_state.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; -import 'package:cake_wallet/store/settings_store.dart'; -import 'package:cake_wallet/themes/theme_base.dart'; +import 'package:cake_wallet/store/app_store.dart'; +import 'package:cake_wallet/themes/core/material_base_theme.dart'; import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/wallet_base.dart'; import 'package:cw_core/wallet_type.dart'; @@ -26,12 +26,12 @@ import 'package:url_launcher/url_launcher.dart'; class MoonPayProvider extends BuyProvider { MoonPayProvider({ - required SettingsStore settingsStore, + required AppStore appStore, required WalletBase wallet, bool isTestEnvironment = false, }) : baseSellUrl = isTestEnvironment ? _baseSellTestUrl : _baseSellProductUrl, baseBuyUrl = isTestEnvironment ? _baseBuyTestUrl : _baseBuyProductUrl, - this._settingsStore = settingsStore, + this._appStore = appStore, super( wallet: wallet, isTestEnvironment: isTestEnvironment, @@ -41,7 +41,7 @@ class MoonPayProvider extends BuyProvider { supportedFiatList: supportedFiatToCryptoPairs( notSupportedFiat: _notSupportedFiat, notSupportedCrypto: _notSupportedCrypto)); - final SettingsStore _settingsStore; + final AppStore _appStore; static const _baseSellTestUrl = 'sell-sandbox.moonpay.com'; static const _baseSellProductUrl = 'sell.moonpay.com'; @@ -86,15 +86,12 @@ class MoonPayProvider extends BuyProvider { static String get _exchangeHelperApiKey => secrets.exchangeHelperApiKey; - static String themeToMoonPayTheme(ThemeBase theme) { + static String themeToMoonPayTheme(MaterialThemeBase theme) { switch (theme.type) { - case ThemeType.bright: case ThemeType.light: return 'light'; case ThemeType.dark: return 'dark'; - case ThemeType.oled: - return 'dark'; } } @@ -237,9 +234,9 @@ class MoonPayProvider extends BuyProvider { required String cryptoCurrencyAddress, String? countryCode}) async { final Map params = { - 'theme': themeToMoonPayTheme(_settingsStore.currentTheme), - 'language': _settingsStore.languageCode, - 'colorCode': _settingsStore.currentTheme.type == ThemeType.dark + 'theme': themeToMoonPayTheme(_appStore.themeStore.currentTheme), + 'language': _appStore.settingsStore.languageCode, + 'colorCode': _appStore.themeStore.currentTheme.isDark ? '#${Palette.blueCraiola.value.toRadixString(16).substring(2, 8)}' : '#${Palette.moderateSlateBlue.value.toRadixString(16).substring(2, 8)}', 'baseCurrencyCode': isBuyAction ? quote.fiatCurrency.name : quote.cryptoCurrency.name, @@ -260,7 +257,6 @@ class MoonPayProvider extends BuyProvider { try { final uri = await requestMoonPayUrl( walletAddress: cryptoCurrencyAddress, - settingsStore: _settingsStore, isBuyAction: isBuyAction, amount: amount.toString(), params: params); @@ -289,7 +285,6 @@ class MoonPayProvider extends BuyProvider { Future requestMoonPayUrl({ required String walletAddress, - required SettingsStore settingsStore, required bool isBuyAction, required Map params, String? amount, diff --git a/lib/buy/onramper/onramper_buy_provider.dart b/lib/buy/onramper/onramper_buy_provider.dart index 35683f01d..54283a612 100644 --- a/lib/buy/onramper/onramper_buy_provider.dart +++ b/lib/buy/onramper/onramper_buy_provider.dart @@ -8,8 +8,7 @@ import 'package:cake_wallet/buy/pairs_utils.dart'; import 'package:cake_wallet/buy/payment_method.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/store/settings_store.dart'; -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/core/theme_store.dart'; import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/utils/print_verbose.dart'; import 'package:cw_core/wallet_base.dart'; @@ -18,7 +17,7 @@ import 'package:http/http.dart' as http; import 'package:url_launcher/url_launcher.dart'; class OnRamperBuyProvider extends BuyProvider { - OnRamperBuyProvider(this._settingsStore, + OnRamperBuyProvider(this._themeStore, {required WalletBase wallet, bool isTestEnvironment = false}) : super(wallet: wallet, isTestEnvironment: isTestEnvironment, @@ -39,7 +38,7 @@ class OnRamperBuyProvider extends BuyProvider { static const List _notSupportedFiat = []; static Map _onrampMetadata = {}; - final SettingsStore _settingsStore; + final ThemeStore _themeStore; String? recommendedPaymentType; @@ -246,17 +245,13 @@ class OnRamperBuyProvider extends BuyProvider { String? countryCode}) async { final actionType = isBuyAction ? 'buy' : 'sell'; - final primaryColor = getColorStr(Theme.of(context).primaryColor); - final secondaryColor = getColorStr(Theme.of(context).colorScheme.background); - final primaryTextColor = getColorStr(Theme.of(context).extension()!.titleColor); + final primaryColor = getColorStr(Theme.of(context).colorScheme.primary,); + final secondaryColor = getColorStr(Theme.of(context).colorScheme.surface); + final primaryTextColor = getColorStr(Theme.of(context).colorScheme.onSurface); final secondaryTextColor = - getColorStr(Theme.of(context).extension()!.secondaryTextColor); - final containerColor = getColorStr(Theme.of(context).colorScheme.background); - var cardColor = getColorStr(Theme.of(context).cardColor); - - if (_settingsStore.currentTheme.title == S.current.high_contrast_theme) { - cardColor = getColorStr(Colors.white); - } + getColorStr(Theme.of(context).colorScheme.onSurfaceVariant); + final containerColor = getColorStr(Theme.of(context).colorScheme.surface); + var cardColor = getColorStr(Theme.of(context).colorScheme.surfaceContainer); final defaultCrypto = quote.cryptoCurrency.title + _getNormalizeNetwork(quote.cryptoCurrency).toLowerCase(); diff --git a/lib/core/backup_service.dart b/lib/core/backup_service.dart index c7d10598b..2e8523024 100644 --- a/lib/core/backup_service.dart +++ b/lib/core/backup_service.dart @@ -3,7 +3,7 @@ import 'dart:io'; import 'package:cake_wallet/core/secure_storage.dart'; import 'package:cake_wallet/entities/get_encryption_key.dart'; import 'package:cake_wallet/entities/transaction_description.dart'; -import 'package:cake_wallet/themes/theme_list.dart'; +import 'package:cake_wallet/themes/utils/theme_list.dart'; import 'package:cw_core/root_dir.dart'; import 'package:cake_wallet/utils/device_info.dart'; import 'package:cw_core/utils/print_verbose.dart'; diff --git a/lib/di.dart b/lib/di.dart index c8b002008..140a26698 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -39,6 +39,7 @@ import 'package:cake_wallet/src/screens/settings/background_sync_page.dart'; import 'package:cake_wallet/src/screens/wallet_connect/services/bottom_sheet_service.dart'; import 'package:cake_wallet/src/screens/wallet_connect/services/key_service/wallet_connect_key_service.dart'; import 'package:cake_wallet/src/screens/wallet_connect/services/walletkit_service.dart'; +import 'package:cake_wallet/themes/core/theme_store.dart'; import 'package:cake_wallet/view_model/dev/monero_background_sync.dart'; import 'package:cake_wallet/view_model/dev/secure_preferences.dart'; import 'package:cake_wallet/view_model/dev/shared_preferences.dart'; @@ -152,11 +153,9 @@ import 'package:cake_wallet/src/screens/wallet/wallet_edit_page.dart'; import 'package:cake_wallet/src/screens/wallet_connect/wc_connections_listing_view.dart'; import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_arguments.dart'; import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_page.dart'; -import 'package:cake_wallet/themes/theme_list.dart'; import 'package:cake_wallet/utils/device_info.dart'; import 'package:cake_wallet/store/anonpay/anonpay_transactions_store.dart'; import 'package:cake_wallet/utils/payment_request.dart'; -import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cake_wallet/view_model/buy/buy_sell_view_model.dart'; import 'package:cake_wallet/view_model/animated_ur_model.dart'; import 'package:cake_wallet/view_model/dashboard/desktop_sidebar_view_model.dart'; @@ -325,6 +324,11 @@ Future setup({ if (!_isSetupFinished) { getIt.registerSingletonAsync(() => SharedPreferences.getInstance()); getIt.registerSingleton(secureStorage); + getIt.registerSingletonAsync(() async { + final store = ThemeStore(); + await store.loadThemePreferences(); + return store; + }); } final isBitcoinBuyEnabled = (secrets.wyreSecretKey.isNotEmpty) && @@ -335,10 +339,6 @@ Future setup({ nodeSource: _nodeSource, powNodeSource: _powNodeSource, isBitcoinBuyEnabled: isBitcoinBuyEnabled, - // Enforce darkTheme on platforms other than mobile till the design for other themes is completed - initialTheme: responsiveLayoutUtil.shouldRenderMobileUI && DeviceInfo.instance.isMobile - ? null - : ThemeList.darkTheme, ); if (_isSetupFinished) { @@ -356,7 +356,8 @@ Future setup({ authenticationStore: getIt.get(), walletList: getIt.get(), settingsStore: getIt.get(), - nodeListStore: getIt.get())); + nodeListStore: getIt.get(), + themeStore: getIt.get())); getIt.registerSingleton( TradesStore(tradesSource: _tradesSource, settingsStore: getIt.get())); getIt.registerSingleton( @@ -901,7 +902,7 @@ Future setup({ getIt.get(param1: account))); getIt.registerFactory(() => - DisplaySettingsViewModel(getIt.get())); + DisplaySettingsViewModel(getIt.get(), getIt.get())); getIt.registerFactory(() => SilentPaymentsSettingsViewModel(getIt.get(), getIt.get().wallet!)); @@ -1030,13 +1031,13 @@ Future setup({ getIt.get().wallet!.isHardwareWallet ? getIt.get() : null)); getIt.registerFactory(() => MoonPayProvider( - settingsStore: getIt.get().settingsStore, + appStore: getIt.get(), wallet: getIt.get().wallet!, isTestEnvironment: kDebugMode, )); getIt.registerFactory(() => OnRamperBuyProvider( - getIt.get().settingsStore, + getIt.get(), wallet: getIt.get().wallet!, )); @@ -1056,7 +1057,7 @@ Future setup({ _tradesSource, getIt.get(), getIt.get(), - getIt.get().settingsStore, + getIt.get(), getIt.get(), getIt.get(), getIt.get(), @@ -1236,7 +1237,7 @@ Future setup({ TradeDetailsViewModel( tradeForDetails: trade, trades: _tradesSource, - settingsStore: getIt.get())); + appStore: getIt.get())); getIt.registerFactory(() => CakeFeaturesViewModel(getIt.get())); @@ -1431,7 +1432,7 @@ Future setup({ (AnonpayInvoiceInfo anonpayInvoiceInfo, _) => AnonpayDetailsViewModel( anonPayApi: getIt.get(), anonpayInvoiceInfo: anonpayInvoiceInfo, - settingsStore: getIt.get(), + themeStore: getIt.get(), )); getIt.registerFactoryParam( @@ -1440,7 +1441,7 @@ Future setup({ sessionId, transactionInfo, payjoinSessionSource: _payjoinSessionSource, - settingsStore: getIt.get(), + themeStore: getIt.get(), )); getIt.registerFactoryParam( diff --git a/lib/entities/main_actions.dart b/lib/entities/main_actions.dart index 76db7fa77..9fd1481a5 100644 --- a/lib/entities/main_actions.dart +++ b/lib/entities/main_actions.dart @@ -29,7 +29,7 @@ class MainActions { static MainActions showWalletsAction = MainActions._( name: (context) => S.of(context).wallets, - image: 'assets/images/wallet_new.png', + image: 'assets/images/wallet_icon.png', onTap: (BuildContext context, DashboardViewModel viewModel) async { Navigator.pushNamed( context, @@ -42,7 +42,7 @@ class MainActions { static MainActions receiveAction = MainActions._( name: (context) => S.of(context).receive, - image: 'assets/images/received.png', + image: 'assets/images/receive.png', onTap: (BuildContext context, DashboardViewModel viewModel) async { Navigator.pushNamed(context, Routes.addressPage); }, @@ -50,7 +50,7 @@ class MainActions { static MainActions swapAction = MainActions._( name: (context) => S.of(context).swap, - image: 'assets/images/transfer.png', + image: 'assets/images/swap.png', isEnabled: (viewModel) => viewModel.isEnabledSwapAction, canShow: (viewModel) => viewModel.hasSwapAction, onTap: (BuildContext context, DashboardViewModel viewModel) async { @@ -62,7 +62,7 @@ class MainActions { static MainActions sendAction = MainActions._( name: (context) => S.of(context).send, - image: 'assets/images/upload.png', + image: 'assets/images/send2.png', isEnabled: (viewModel) => viewModel.canSend, onTap: (BuildContext context, DashboardViewModel viewModel) async { Navigator.pushNamed(context, Routes.send); @@ -71,7 +71,7 @@ class MainActions { static MainActions tradeAction = MainActions._( name: (context) => S.of(context).buy, - image: 'assets/images/buy_sell.png', + image: 'assets/images/buy.png', isEnabled: (viewModel) => viewModel.isEnabledTradeAction, canShow: (viewModel) => viewModel.hasTradeAction, onTap: (BuildContext context, DashboardViewModel viewModel) async { diff --git a/lib/entities/preferences_key.dart b/lib/entities/preferences_key.dart index 2a8c2d019..238ad500c 100644 --- a/lib/entities/preferences_key.dart +++ b/lib/entities/preferences_key.dart @@ -34,6 +34,7 @@ class PreferencesKey { static const disableExchangeKey = 'disable_exchange'; static const exchangeStatusKey = 'exchange_status'; static const currentTheme = 'current_theme'; + static const themeMode = 'theme_mode'; static const displayActionListModeKey = 'display_list_mode'; static const currentPinLength = 'current_pin_length'; static const currentLanguageCode = 'language_code'; diff --git a/lib/entities/qr_scanner.dart b/lib/entities/qr_scanner.dart index c4d37ad6c..31353a8f8 100644 --- a/lib/entities/qr_scanner.dart +++ b/lib/entities/qr_scanner.dart @@ -15,7 +15,7 @@ Future presentQRScanner(BuildContext context) async { try { final result = await Navigator.of(context).push( MaterialPageRoute( - builder:(context) { + builder: (context) { return BarcodeScannerSimple(); }, ), @@ -67,7 +67,7 @@ class _BarcodeScannerSimpleState extends State { void _handleBarcodeInternal(BarcodeCapture barcodes) { for (final barcode in barcodes.barcodes) { // don't handle unknown QR codes - if (barcode.rawValue?.trim().isEmpty??false == false) continue; + if (barcode.rawValue?.trim().isEmpty ?? false == false) continue; if (barcode.rawValue!.startsWith("ur:")) { if (urCodes.contains(barcode.rawValue)) continue; setState(() { @@ -81,7 +81,8 @@ class _BarcodeScannerSimpleState extends State { SchedulerBinding.instance.addPostFrameCallback((_) { Navigator.of(context).pop(ur.inputs.join("\n")); }); - }; + } + ; } } if (urCodes.isNotEmpty) return; @@ -110,18 +111,21 @@ class _BarcodeScannerSimpleState extends State { ToggleFlashlightButton(controller: ctrl), ], ), - backgroundColor: Colors.black, + backgroundColor: Theme.of(context).colorScheme.surface, body: Stack( children: [ MobileScanner( onDetect: _handleBarcode, controller: ctrl, ), - if (ur.inputs.length != 0) - Center(child: - Text( + if (ur.inputs.length != 0) + Center( + child: Text( "${ur.inputs.length}/${ur.count}", - style: Theme.of(context).textTheme.displayLarge?.copyWith(color: Colors.white) + style: Theme.of(context) + .textTheme + .displayLarge + ?.copyWith(color: Theme.of(context).colorScheme.onSurface), ), ), SizedBox( @@ -158,7 +162,6 @@ class _BarcodeScannerSimpleState extends State { } } - class ToggleFlashlightButton extends StatelessWidget { const ToggleFlashlightButton({required this.controller, super.key}); @@ -199,9 +202,9 @@ class ToggleFlashlightButton extends StatelessWidget { }, ); case TorchState.unavailable: - return const Icon( + return Icon( Icons.no_flash, - color: Colors.grey, + color: Theme.of(context).colorScheme.onSurfaceVariant, ); } }, @@ -326,16 +329,14 @@ class ProgressPainter extends CustomPainter { const fullAngle = 360.0; var startAngle = 0.0; for (int i = 0; i < urQrProgress.expectedPartCount.toInt(); i++) { - var sweepAngle = - (1 / urQrProgress.expectedPartCount) * fullAngle * pi / 180.0; - drawSector(canvas, urQrProgress.receivedPartIndexes.contains(i), rect, - startAngle, sweepAngle); + var sweepAngle = (1 / urQrProgress.expectedPartCount) * fullAngle * pi / 180.0; + drawSector( + canvas, urQrProgress.receivedPartIndexes.contains(i), rect, startAngle, sweepAngle); startAngle += sweepAngle; } } - void drawSector(Canvas canvas, bool isActive, Rect rect, double startAngle, - double sweepAngle) { + void drawSector(Canvas canvas, bool isActive, Rect rect, double startAngle, double sweepAngle) { final paint = Paint() ..style = PaintingStyle.stroke ..strokeWidth = 8 diff --git a/lib/main.dart b/lib/main.dart index 43b5951df..167373d87 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -25,7 +25,8 @@ import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/root/root.dart'; import 'package:cake_wallet/store/app_store.dart'; import 'package:cake_wallet/store/authentication_store.dart'; -import 'package:cake_wallet/themes/theme_base.dart'; +import 'package:cake_wallet/themes/core/material_base_theme.dart'; +import 'package:cake_wallet/themes/utils/theme_provider.dart'; import 'package:cake_wallet/utils/device_info.dart'; import 'package:cake_wallet/utils/exception_handler.dart'; import 'package:cake_wallet/view_model/link_view_model.dart'; @@ -206,8 +207,7 @@ Future initializeAppConfigs({bool loadWallet = true}) async { final havenSeedStoreBoxKey = await getEncryptionKey(secureStorage: secureStorage, forKey: HavenSeedStore.boxKey); - final havenSeedStore = await CakeHive.openBox( - HavenSeedStore.boxName, + final havenSeedStore = await CakeHive.openBox(HavenSeedStore.boxName, encryptionKey: havenSeedStoreBoxKey); await initialSetup( @@ -232,25 +232,26 @@ Future initializeAppConfigs({bool loadWallet = true}) async { ); } -Future initialSetup( - {required bool loadWallet, - required SharedPreferences sharedPreferences, - required Box nodes, - required Box powNodes, - required Box walletInfoSource, - required Box contactSource, - required Box tradesSource, - required Box ordersSource, - // required FiatConvertationService fiatConvertationService, - required Box