From 09c942564ed94ca2e5ec0faccfce808be4076edc Mon Sep 17 00:00:00 2001 From: Rafael Saes <76502841+saltrafael@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:28:31 -0300 Subject: [PATCH] Cw 396 additional themes (#962) * fix: SectionStandardList using BuildContext as param * refactor: deprecated backgroundColor -> colorScheme.background * refactor: themeBase and current themes * refactor: accentTextTheme.titleLarge.color -> dialogTheme.backgroundColor * refactor: gradient background * refactor: text themes using the same color as primaryColor * refactor: accentTextTheme.bodySmall.color -> cardColor * refactor: text themes using same dialogBackgroundColor * refactor: scrollbarTheme * refactor: create SyncIndicatorTheme * refactor: SectionDivider * refactor: base_page improvements and simplify * refactor: collapsible_standart_list improvements * refactor: accentTextTheme.bodyLarge.backgroundColor -> KeyboardTheme.keyboardBarColor * refactor: create PinCodeTheme for accentTextTheme.bodyMedium * refactor: create SupportPageTheme for accentTextTheme.displayLarge.backgroundColor and fix cases that use it * refactor: accentTextTheme.displayLarge.color -> disabledColor * refactor: create ExchangePageTheme * refactor: create DashboardPageTheme and use textColor * refactor: create NewWalletTheme for accentTextTheme.displayMedium * refactor: create BalancePageTheme for accentTextTheme.displaySmall.backgroundColor * refactor: create AddressTheme for accentTextTheme.displaySmall.color * refactor: create IndicatorDotTheme * refactor: create CakeMenuTheme * refactor: create FilterTheme * refactor: create WalletListTheme * refactor: accentTextTheme.bodySmall.decorationColor -> InfoTheme.textColor * refactor: accentTextTheme.titleLarge.backgroundColor -> PickerTheme.dividerColor * refactor: primaryTextTheme.bodyLarge.backgroundColor -> AlertTheme.leftButtonTextColor * refactor: primaryTextTheme.displayLarge.backgroundColor -> OrderTheme.iconColor * refactor: create SendPageTheme * fix: missing migrated styles * refactor: primaryTextTheme.labelSmall.decorationColor -> PlaceholderTheme.color * refactor: create TransactionTradeTheme * refactor: create CakeTextTheme * refactor: create AccountListTheme * refactor: create ReceivePageTheme * refactor: create QRCodeTheme * refactor: move remaining items to CakeTextTheme and some missing fixes * feat(display_settings): add new theme selector * feat: additional themes * fix: conflict error * fix(lag): move colorScheme initialization to constructor * feat: add backdropColor to alert and picker backdrop filters * fix: merge fixes * fix: send template page missing new colors * fix: anonpay pages title and icon colors * fix: merge fixes * fix: unspent coins page * fix: also fix exchange template * fix: missing checkbox * fix: fixes for high contrast theme * Merge branch 'main' into CW-396-additional-themes * fix: merge fixes * fix: .gitignore and rm added files * Fix review comments --------- Co-authored-by: OmarHatem --- .gitignore | 2 +- cw_bitcoin/pubspec.lock | 2 +- cw_core/pubspec.lock | 2 +- cw_monero/example/pubspec.lock | 2 +- cw_monero/pubspec.lock | 2 +- lib/palette.dart | 9 +- .../anonpay_details/anonpay_details_page.dart | 3 +- lib/src/screens/backup/backup_page.dart | 2 +- .../backup/edit_backup_password_page.dart | 11 +- lib/src/screens/base_page.dart | 66 ++- lib/src/screens/buy/buy_webview_page.dart | 3 - lib/src/screens/buy/pre_order_page.dart | 26 +- .../screens/contact/contact_list_page.dart | 34 +- lib/src/screens/contact/contact_page.dart | 20 +- lib/src/screens/dashboard/dashboard_page.dart | 53 +- .../desktop_action_button.dart | 20 +- .../desktop_sidebar/side_menu_item.dart | 3 +- .../desktop_wallet_selection_dropdown.dart | 10 +- .../desktop_widgets/dropdown_item_widget.dart | 3 +- .../screens/dashboard/edit_token_page.dart | 9 +- .../screens/dashboard/home_settings_page.dart | 18 +- .../dashboard/widgets/action_button.dart | 8 +- .../dashboard/widgets/address_page.dart | 46 +- .../widgets/anonpay_transaction_row.dart | 8 +- .../dashboard/widgets/balance_page.dart | 47 +- .../dashboard/widgets/date_section_raw.dart | 6 +- .../dashboard/widgets/filter_widget.dart | 17 +- .../screens/dashboard/widgets/header_row.dart | 11 +- .../dashboard/widgets/market_place_page.dart | 6 +- .../dashboard/widgets/menu_widget.dart | 223 ++++---- .../screens/dashboard/widgets/order_row.dart | 14 +- .../present_receive_option_picker.dart | 22 +- .../dashboard/widgets/sync_indicator.dart | 7 +- .../widgets/sync_indicator_icon.dart | 6 +- .../screens/dashboard/widgets/trade_row.dart | 8 +- .../dashboard/widgets/transaction_raw.dart | 21 +- .../dashboard/widgets/transactions_page.dart | 6 +- .../screens/disclaimer/disclaimer_page.dart | 47 +- lib/src/screens/exchange/exchange_page.dart | 20 +- .../exchange/exchange_template_page.dart | 43 +- .../widgets/currency_picker_item_widget.dart | 27 +- .../widgets/currency_picker_widget.dart | 6 +- .../exchange/widgets/exchange_card.dart | 62 +-- .../mobile_exchange_cards_section.dart | 12 +- .../widgets/present_provider_picker.dart | 6 +- .../exchange_trade/exchange_confirm_page.dart | 43 +- .../exchange_trade/exchange_trade_page.dart | 54 +- .../exchange_trade/information_page.dart | 12 +- lib/src/screens/faq/faq_item.dart | 7 +- .../ionia/auth/ionia_create_account_page.dart | 21 +- .../screens/ionia/auth/ionia_login_page.dart | 11 +- .../ionia/auth/ionia_verify_otp_page.dart | 17 +- .../ionia/auth/ionia_welcome_page.dart | 17 +- .../ionia/cards/ionia_account_cards_page.dart | 46 +- .../ionia/cards/ionia_account_page.dart | 16 +- .../cards/ionia_activate_debit_card_page.dart | 11 +- .../cards/ionia_buy_card_detail_page.dart | 45 +- .../ionia/cards/ionia_buy_gift_card.dart | 53 +- .../ionia/cards/ionia_custom_redeem_page.dart | 48 +- .../ionia/cards/ionia_custom_tip_page.dart | 48 +- .../ionia/cards/ionia_debit_card_page.dart | 50 +- .../cards/ionia_gift_card_detail_page.dart | 19 +- .../ionia/cards/ionia_manage_cards_page.dart | 65 +-- .../ionia/cards/ionia_more_options_page.dart | 13 +- .../cards/ionia_payment_status_page.dart | 25 +- .../ionia/widgets/ionia_alert_model.dart | 11 +- .../ionia/widgets/ionia_filter_modal.dart | 12 +- lib/src/screens/ionia/widgets/ionia_tile.dart | 6 +- .../ionia/widgets/rounded_checkbox.dart | 2 +- .../ionia/widgets/text_icon_button.dart | 5 +- .../monero_account_edit_or_create_page.dart | 2 +- .../monero_account_list_page.dart | 4 +- .../monero_accounts/widgets/account_tile.dart | 44 +- .../advanced_privacy_settings_page.dart | 11 +- .../screens/new_wallet/new_wallet_page.dart | 33 +- .../new_wallet/new_wallet_type_page.dart | 5 +- .../new_wallet/widgets/select_button.dart | 27 +- .../nodes/node_create_or_edit_page.dart | 5 +- .../screens/nodes/widgets/node_list_row.dart | 13 +- .../order_details/order_details_page.dart | 3 +- lib/src/screens/pin_code/pin_code_widget.dart | 28 +- .../screens/receive/anonpay_invoice_page.dart | 29 +- .../screens/receive/anonpay_receive_page.dart | 37 +- .../screens/receive/fullscreen_qr_page.dart | 34 +- lib/src/screens/receive/receive_page.dart | 76 +-- .../widgets/anonpay_currency_input_field.dart | 29 +- .../receive/widgets/anonpay_input_form.dart | 22 +- .../widgets/anonpay_status_section.dart | 25 +- .../receive/widgets/copy_link_item.dart | 16 +- .../receive/widgets/currency_input_field.dart | 30 +- .../screens/receive/widgets/header_tile.dart | 12 +- .../screens/receive/widgets/qr_widget.dart | 19 +- .../release_notes/release_notes_screen.dart | 15 +- lib/src/screens/rescan/rescan_page.dart | 5 +- .../restore/restore_from_backup_page.dart | 5 +- .../restore_wallet_from_seed_details.dart | 5 +- .../screens/restore/sweeping_wallet_page.dart | 17 +- .../wallet_restore_from_keys_form.dart | 6 +- .../wallet_restore_from_seed_form.dart | 6 +- .../screens/restore/wallet_restore_page.dart | 21 +- .../restore/widgets/restore_button.dart | 1 + lib/src/screens/seed/pre_seed_page.dart | 5 +- lib/src/screens/seed/wallet_seed_page.dart | 17 +- .../seed_language/seed_language_page.dart | 3 +- lib/src/screens/send/send_page.dart | 8 +- lib/src/screens/send/send_template_page.dart | 26 +- .../widgets/choose_yat_address_alert.dart | 7 +- .../send/widgets/confirm_sending_alert.dart | 26 +- .../widgets/prefix_currency_icon_widget.dart | 13 +- lib/src/screens/send/widgets/send_card.dart | 58 +-- .../send/widgets/send_template_card.dart | 23 +- .../desktop_settings_page.dart | 6 +- .../settings/display_settings_page.dart | 14 +- .../screens/settings/manage_nodes_page.dart | 3 +- .../widgets/settings_cell_with_arrow.dart | 3 +- .../widgets/settings_choices_cell.dart | 14 +- .../widgets/settings_link_provider_cell.dart | 2 +- .../widgets/settings_picker_cell.dart | 3 +- .../widgets/settings_theme_choice.dart | 117 +++++ .../widgets/settings_version_cell.dart | 3 +- lib/src/screens/setup_2fa/setup_2fa.dart | 5 +- .../setup_2fa/setup_2fa_enter_code_page.dart | 2 +- .../screens/setup_2fa/setup_2fa_qr_page.dart | 5 +- .../widgets/popup_cancellable_alert.dart | 5 +- .../address_edit_or_create_page.dart | 5 +- .../support/widgets/support_tiles.dart | 7 +- .../support_other_links_page.dart | 10 +- .../trade_details/trade_details_page.dart | 3 +- .../transaction_details_page.dart | 8 +- .../widgets/textfield_list_row.dart | 14 +- .../unspent_coins_details_page.dart | 3 +- .../unspent_coins_list_page.dart | 2 +- .../widgets/unspent_coins_list_item.dart | 20 +- .../widgets/unspent_coins_switch_row.dart | 6 +- lib/src/screens/wallet/wallet_edit_page.dart | 2 +- .../screens/wallet_keys/wallet_keys_page.dart | 106 ++-- .../screens/wallet_list/wallet_list_page.dart | 54 +- lib/src/screens/welcome/welcome_page.dart | 42 +- lib/src/screens/yat_emoji_id.dart | 12 +- lib/src/widgets/add_template_button.dart | 13 +- lib/src/widgets/address_text_field.dart | 26 +- lib/src/widgets/alert_background.dart | 6 +- lib/src/widgets/alert_with_one_action.dart | 10 +- lib/src/widgets/base_alert_dialog.dart | 41 +- lib/src/widgets/base_text_form_field.dart | 18 +- lib/src/widgets/blockchain_height_widget.dart | 3 +- lib/src/widgets/cake_scrollbar.dart | 5 +- lib/src/widgets/check_box_picker.dart | 30 +- lib/src/widgets/checkbox_widget.dart | 10 +- .../widgets/collapsible_standart_list.dart | 82 +-- lib/src/widgets/dashboard_card_widget.dart | 17 +- lib/src/widgets/gradient_background.dart | 30 ++ lib/src/widgets/introducing_card.dart | 14 +- lib/src/widgets/list_row.dart | 12 +- lib/src/widgets/picker.dart | 82 ++- .../widgets/picker_inner_wrapper_widget.dart | 5 +- lib/src/widgets/search_bar_widget.dart | 13 +- lib/src/widgets/section_divider.dart | 27 +- lib/src/widgets/seed_widget.dart | 22 +- lib/src/widgets/setting_action_button.dart | 11 +- lib/src/widgets/standard_checkbox.dart | 14 +- lib/src/widgets/standard_list.dart | 180 +++---- lib/src/widgets/standard_list_card.dart | 5 +- lib/src/widgets/standard_list_status_row.dart | 12 +- lib/src/widgets/standard_switch.dart | 10 +- lib/src/widgets/template_tile.dart | 10 +- lib/src/widgets/trail_button.dart | 6 +- lib/themes/bitcoin_dark_theme.dart | 14 + lib/themes/bitcoin_light_theme.dart | 13 + lib/themes/bright_theme.dart | 369 ++++---------- lib/themes/dark_theme.dart | 482 ++++++++---------- lib/themes/extensions/account_list_theme.dart | 58 +++ lib/themes/extensions/address_theme.dart | 24 + lib/themes/extensions/alert_theme.dart | 28 + lib/themes/extensions/balance_page_theme.dart | 53 ++ .../extensions/cake_scrollbar_theme.dart | 28 + lib/themes/extensions/cake_text_theme.dart | 65 +++ .../extensions/dashboard_page_theme.dart | 79 +++ .../extensions/exchange_page_theme.dart | 88 ++++ lib/themes/extensions/filter_theme.dart | 68 +++ .../extensions/indicator_dot_theme.dart | 30 ++ lib/themes/extensions/info_theme.dart | 21 + lib/themes/extensions/keyboard_theme.dart | 26 + lib/themes/extensions/menu_theme.dart | 75 +++ lib/themes/extensions/new_wallet_theme.dart | 30 ++ lib/themes/extensions/order_theme.dart | 21 + lib/themes/extensions/picker_theme.dart | 54 ++ lib/themes/extensions/pin_code_theme.dart | 28 + lib/themes/extensions/placeholder_theme.dart | 20 + lib/themes/extensions/qr_code_theme.dart | 28 + lib/themes/extensions/receive_page_theme.dart | 70 +++ lib/themes/extensions/seed_widget_theme.dart | 22 + lib/themes/extensions/send_page_theme.dart | 117 +++++ lib/themes/extensions/support_page_theme.dart | 21 + .../extensions/sync_indicator_theme.dart | 48 ++ .../extensions/transaction_trade_theme.dart | 29 ++ lib/themes/extensions/wallet_list_theme.dart | 38 ++ lib/themes/high_contrast_theme.dart | 118 +++++ lib/themes/light_theme.dart | 470 ++++++++--------- lib/themes/matrix_green_theme.dart | 14 + lib/themes/monero_dark_theme.dart | 194 +++++++ lib/themes/monero_light_theme.dart | 159 ++++++ lib/themes/theme_base.dart | 148 +++++- lib/themes/theme_list.dart | 39 +- res/values/strings_ar.arb | 8 +- res/values/strings_bg.arb | 6 + res/values/strings_cs.arb | 6 + res/values/strings_de.arb | 6 + res/values/strings_en.arb | 6 + res/values/strings_es.arb | 6 + res/values/strings_fr.arb | 6 + res/values/strings_ha.arb | 6 + res/values/strings_hi.arb | 6 + res/values/strings_hr.arb | 6 + res/values/strings_id.arb | 6 + res/values/strings_it.arb | 6 + res/values/strings_ja.arb | 8 +- res/values/strings_ko.arb | 8 +- res/values/strings_my.arb | 8 +- res/values/strings_nl.arb | 6 + res/values/strings_pl.arb | 6 + res/values/strings_pt.arb | 6 + res/values/strings_ru.arb | 8 +- res/values/strings_th.arb | 8 +- res/values/strings_tr.arb | 6 + res/values/strings_uk.arb | 6 + res/values/strings_ur.arb | 8 +- res/values/strings_yo.arb | 10 +- res/values/strings_zh.arb | 10 +- 229 files changed, 4089 insertions(+), 2869 deletions(-) create mode 100644 lib/src/screens/settings/widgets/settings_theme_choice.dart create mode 100644 lib/src/widgets/gradient_background.dart create mode 100644 lib/themes/bitcoin_dark_theme.dart create mode 100644 lib/themes/bitcoin_light_theme.dart create mode 100644 lib/themes/extensions/account_list_theme.dart create mode 100644 lib/themes/extensions/address_theme.dart create mode 100644 lib/themes/extensions/alert_theme.dart create mode 100644 lib/themes/extensions/balance_page_theme.dart create mode 100644 lib/themes/extensions/cake_scrollbar_theme.dart create mode 100644 lib/themes/extensions/cake_text_theme.dart create mode 100644 lib/themes/extensions/dashboard_page_theme.dart create mode 100644 lib/themes/extensions/exchange_page_theme.dart create mode 100644 lib/themes/extensions/filter_theme.dart create mode 100644 lib/themes/extensions/indicator_dot_theme.dart create mode 100644 lib/themes/extensions/info_theme.dart create mode 100644 lib/themes/extensions/keyboard_theme.dart create mode 100644 lib/themes/extensions/menu_theme.dart create mode 100644 lib/themes/extensions/new_wallet_theme.dart create mode 100644 lib/themes/extensions/order_theme.dart create mode 100644 lib/themes/extensions/picker_theme.dart create mode 100644 lib/themes/extensions/pin_code_theme.dart create mode 100644 lib/themes/extensions/placeholder_theme.dart create mode 100644 lib/themes/extensions/qr_code_theme.dart create mode 100644 lib/themes/extensions/receive_page_theme.dart create mode 100644 lib/themes/extensions/seed_widget_theme.dart create mode 100644 lib/themes/extensions/send_page_theme.dart create mode 100644 lib/themes/extensions/support_page_theme.dart create mode 100644 lib/themes/extensions/sync_indicator_theme.dart create mode 100644 lib/themes/extensions/transaction_trade_theme.dart create mode 100644 lib/themes/extensions/wallet_list_theme.dart create mode 100644 lib/themes/high_contrast_theme.dart create mode 100644 lib/themes/matrix_green_theme.dart create mode 100644 lib/themes/monero_dark_theme.dart create mode 100644 lib/themes/monero_light_theme.dart diff --git a/.gitignore b/.gitignore index 6fd8f33d6..09583004b 100644 --- a/.gitignore +++ b/.gitignore @@ -143,4 +143,4 @@ assets/images/app_logo.png macos/Runner/Info.plist macos/Runner/DebugProfile.entitlements -macos/Runner/Release.entitlements \ No newline at end of file +macos/Runner/Release.entitlements diff --git a/cw_bitcoin/pubspec.lock b/cw_bitcoin/pubspec.lock index 4d864059f..bfcd9e5a6 100644 --- a/cw_bitcoin/pubspec.lock +++ b/cw_bitcoin/pubspec.lock @@ -746,5 +746,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.19.0 <4.0.0" + dart: ">=2.19.0 <3.0.0" flutter: ">=3.0.0" diff --git a/cw_core/pubspec.lock b/cw_core/pubspec.lock index 70652ec35..01e19dda4 100644 --- a/cw_core/pubspec.lock +++ b/cw_core/pubspec.lock @@ -665,5 +665,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.19.0 <4.0.0" + dart: ">=2.19.0 <3.0.0" flutter: ">=3.0.0" diff --git a/cw_monero/example/pubspec.lock b/cw_monero/example/pubspec.lock index 19d9cef8f..f4c36e69c 100644 --- a/cw_monero/example/pubspec.lock +++ b/cw_monero/example/pubspec.lock @@ -399,5 +399,5 @@ packages: source: hosted version: "0.2.0+3" sdks: - dart: ">=2.18.1 <4.0.0" + dart: ">=2.18.1 <3.0.0" flutter: ">=3.0.0" diff --git a/cw_monero/pubspec.lock b/cw_monero/pubspec.lock index 1e33631d5..437184a7d 100644 --- a/cw_monero/pubspec.lock +++ b/cw_monero/pubspec.lock @@ -672,5 +672,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.19.0 <4.0.0" + dart: ">=2.19.0 <3.0.0" flutter: ">=3.0.0" diff --git a/lib/palette.dart b/lib/palette.dart index 6f4526e67..46e2e8165 100644 --- a/lib/palette.dart +++ b/lib/palette.dart @@ -15,6 +15,9 @@ class Palette { static const Color nightBlue = Color.fromRGBO(46, 57, 96, 1.0); static const Color moderateOrangeYellow = Color.fromRGBO(245, 134, 82, 1.0); static const Color moderateOrange = Color.fromRGBO(235, 117, 63, 1.0); + static const Color moneroOrange = Color.fromRGBO(255, 102, 0, 1.0); + static const Color moneroLightOrange = Color.fromRGBO(250, 240, 246, 1.0); + static const Color bitcoinOrange = Color.fromRGBO(242, 169, 0, 1.0); static const Color shineGreen = Color.fromRGBO(76, 189, 87, 1.0); static const Color moderateGreen = Color.fromRGBO(45, 158, 56, 1.0); static const Color cornflower = Color.fromRGBO(85, 147, 240, 1.0); @@ -48,6 +51,7 @@ class Palette { static const Color paleCornflowerBlue = Color.fromRGBO(185, 196, 237, 1.0); static const Color manatee = Color.fromRGBO(153, 161, 176, 1.0); static const Color stateGray = Color.fromRGBO(68, 74, 89, 1.0); + static const Color highContrastGray = Color.fromRGBO(76, 76, 76, 1.0); static const Color frostySky = Color.fromRGBO(0, 184, 250, 1.0); } @@ -90,4 +94,7 @@ class PaletteDark { static const Color lightPurpleBlue = Color.fromRGBO(120, 133, 170, 1.0); static const Color indicatorVioletBlue = Color.fromRGBO(59, 72, 119, 1.0); static const Color granite = Color.fromRGBO(48, 51, 60, 1.0); -} \ No newline at end of file + static const Color matrixGreen = Color.fromRGBO(18, 229, 90, 1.0); + static const Color moneroOrange = Color.fromRGBO(255, 102, 0, 1.0); + static const Color moneroCard = Color.fromRGBO(20, 21, 24, 1.0); +} diff --git a/lib/src/screens/anonpay_details/anonpay_details_page.dart b/lib/src/screens/anonpay_details/anonpay_details_page.dart index 7491bb7a3..fc03617fa 100644 --- a/lib/src/screens/anonpay_details/anonpay_details_page.dart +++ b/lib/src/screens/anonpay_details/anonpay_details_page.dart @@ -42,10 +42,9 @@ class _AnonpayDetailsPageBodyState extends State { @override Widget build(BuildContext context) { return SectionStandardList( - context: context, sectionCount: 1, itemCounter: (int _) => widget.anonpayDetailsViewModel.items.length, - itemBuilder: (_, __, index) { + itemBuilder: (__, index) { final item = widget.anonpayDetailsViewModel.items[index]; if (item is DetailsListStatusItem) { diff --git a/lib/src/screens/backup/backup_page.dart b/lib/src/screens/backup/backup_page.dart index 1b3b7e3d9..f7a224aac 100644 --- a/lib/src/screens/backup/backup_page.dart +++ b/lib/src/screens/backup/backup_page.dart @@ -80,7 +80,7 @@ class BackupPage extends BasePage { isLoading: backupViewModelBase.state is IsExecutingState, onPressed: () => onExportBackup(context), text: S.of(context).export_backup, - color: Theme.of(context).accentTextTheme.bodyLarge!.color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), ), diff --git a/lib/src/screens/backup/edit_backup_password_page.dart b/lib/src/screens/backup/edit_backup_password_page.dart index 40eb722c9..93207c191 100644 --- a/lib/src/screens/backup/edit_backup_password_page.dart +++ b/lib/src/screens/backup/edit_backup_password_page.dart @@ -7,6 +7,7 @@ import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/view_model/edit_backup_password_view_model.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; class EditBackupPasswordPage extends BasePage { EditBackupPasswordPage(this.editBackupPasswordViewModel) @@ -39,19 +40,13 @@ class EditBackupPasswordPage extends BasePage { controller: textEditingController, style: TextStyle( fontSize: 26, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!)))), + color: Theme.of(context).extension()!.titleColor)))), Positioned( child: Observer( builder: (_) => PrimaryButton( onPressed: () => onSave(context), text: S.of(context).save, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, isDisabled: !editBackupPasswordViewModel.canSave)), bottom: 24, diff --git a/lib/src/screens/base_page.dart b/lib/src/screens/base_page.dart index 2e1d50f9a..20c918be6 100644 --- a/lib/src/screens/base_page.dart +++ b/lib/src/screens/base_page.dart @@ -1,7 +1,6 @@ import 'package:cake_wallet/themes/theme_base.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/src/widgets/nav_bar.dart'; @@ -10,22 +9,22 @@ import 'package:cake_wallet/generated/i18n.dart'; enum AppBarStyle { regular, withShadow, transparent } abstract class BasePage extends StatelessWidget { - BasePage() - : _scaffoldKey = GlobalKey(); + BasePage() : _scaffoldKey = GlobalKey(); final GlobalKey _scaffoldKey; - final Image closeButtonImage = - Image.asset('assets/images/close_button.png'); + final Image closeButtonImage = Image.asset('assets/images/close_button.png'); final Image closeButtonImageDarkTheme = - Image.asset('assets/images/close_button_dark_theme.png'); + Image.asset('assets/images/close_button_dark_theme.png'); String? get title => null; - Color get backgroundLightColor => Colors.white; + Color? get backgroundLightColor => null; - Color get backgroundDarkColor => PaletteDark.backgroundColor; + Color? get backgroundDarkColor => null; - Color? get titleColor => null; + bool get gradientBackground => false; + + bool get gradientAll => false; bool get resizeToAvoidBottomInset => true; @@ -43,15 +42,41 @@ abstract class BasePage extends StatelessWidget { void onClose(BuildContext context) => Navigator.of(context).pop(); + Color pageBackgroundColor(BuildContext context) => + (currentTheme.type == ThemeType.dark + ? backgroundDarkColor + : backgroundLightColor) ?? + (gradientBackground && currentTheme.type == ThemeType.bright + ? Colors.transparent + : Theme.of(context).colorScheme.background); + + Color titleColor(BuildContext context) => + (gradientBackground && currentTheme.type == ThemeType.bright) || + (gradientAll && currentTheme.brightness == Brightness.light) + ? Colors.white + : Theme.of(context).appBarTheme.titleTextStyle!.color!; + + Color? pageIconColor(BuildContext context) => titleColor(context); + + Widget closeButton(BuildContext context) => Image.asset( + currentTheme.type == ThemeType.dark + ? 'assets/images/close_button_dark_theme.png' + : 'assets/images/close_button.png', + color: pageIconColor(context), + height: 16, + ); + + Widget backButton(BuildContext context) => Icon( + Icons.arrow_back_ios, + color: pageIconColor(context), + size: 16, + ); + Widget? leading(BuildContext context) { if (ModalRoute.of(context)?.isFirst ?? true) { return null; } - final _backButton = Icon(Icons.arrow_back_ios, - color: titleColor ?? Theme.of(context).primaryTextTheme!.titleLarge!.color!, - size: 16,); - return MergeSemantics( child: SizedBox( height: 37, @@ -66,7 +91,7 @@ abstract class BasePage extends StatelessWidget { (states) => Colors.transparent), ), onPressed: () => onClose(context), - child: _backButton, + child: backButton(context), ), ), ), @@ -83,8 +108,7 @@ abstract class BasePage extends StatelessWidget { fontSize: 18.0, fontWeight: FontWeight.bold, fontFamily: 'Lato', - color: titleColor ?? - Theme.of(context).primaryTextTheme!.titleLarge!.color!), + color: titleColor(context)), ); } @@ -93,9 +117,8 @@ abstract class BasePage extends StatelessWidget { Widget? floatingActionButton(BuildContext context) => null; ObstructingPreferredSizeWidget appBar(BuildContext context) { - final appBarColor = currentTheme.type == ThemeType.dark - ? backgroundDarkColor : backgroundLightColor; - + final appBarColor = pageBackgroundColor(context); + switch (appBarStyle) { case AppBarStyle.regular: // FIX-ME: NavBar no context @@ -139,12 +162,9 @@ abstract class BasePage extends StatelessWidget { @override Widget build(BuildContext context) { - final _backgroundColor = currentTheme.type == ThemeType.dark - ? backgroundDarkColor : backgroundLightColor; - final root = Scaffold( key: _scaffoldKey, - backgroundColor: _backgroundColor, + backgroundColor: pageBackgroundColor(context), resizeToAvoidBottomInset: resizeToAvoidBottomInset, extendBodyBehindAppBar: extendBodyBehindAppBar, endDrawer: endDrawer, diff --git a/lib/src/screens/buy/buy_webview_page.dart b/lib/src/screens/buy/buy_webview_page.dart index b19a112fc..a6ea2ab7b 100644 --- a/lib/src/screens/buy/buy_webview_page.dart +++ b/lib/src/screens/buy/buy_webview_page.dart @@ -24,9 +24,6 @@ class BuyWebViewPage extends BasePage { @override Color get backgroundDarkColor => Colors.white; - @override - Color get titleColor => Palette.darkBlueCraiola; - @override Widget body(BuildContext context) => BuyWebViewPageBody(buyViewModel, ordersStore: ordersStore, url: url); diff --git a/lib/src/screens/buy/pre_order_page.dart b/lib/src/screens/buy/pre_order_page.dart index ccd6a5422..67b9a18a1 100644 --- a/lib/src/screens/buy/pre_order_page.dart +++ b/lib/src/screens/buy/pre_order_page.dart @@ -3,6 +3,10 @@ import 'package:cake_wallet/buy/buy_provider.dart'; import 'package:cake_wallet/buy/moonpay/moonpay_buy_provider.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; import 'package:cake_wallet/src/widgets/picker.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/src/screens/buy/widgets/buy_list_item.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; @@ -58,9 +62,6 @@ class PreOrderPage extends BasePage { @override String get title => S.current.buy + ' ' + walletTypeToString(buyViewModel.wallet.type); - @override - Color get titleColor => Colors.white; - @override bool get resizeToAvoidBottomInset => false; @@ -80,10 +81,7 @@ class PreOrderPage extends BasePage { return KeyboardActions( config: KeyboardActionsConfig( keyboardActionsPlatform: KeyboardActionsPlatform.IOS, - keyboardBarColor: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .backgroundColor!, + keyboardBarColor: Theme.of(context).extension()!.keyboardBarColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -104,10 +102,8 @@ class PreOrderPage extends BasePage { bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)), gradient: LinearGradient(colors: [ - Theme.of(context).primaryTextTheme!.titleMedium!.color!, - Theme.of(context) - .primaryTextTheme!.titleMedium! - .decorationColor!, + Theme.of(context).extension()!.firstGradientColor, + Theme.of(context).extension()!.secondGradientColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight), ), child: Padding( @@ -162,11 +158,11 @@ class PreOrderPage extends BasePage { ), ), hintText: '0.00', - borderColor: Theme.of(context).primaryTextTheme!.bodyLarge!.decorationColor!, + borderColor: Theme.of(context).extension()!.textFieldBorderBottomPanelColor, borderWidth: 0.5, textStyle: TextStyle(fontSize: 36, fontWeight: FontWeight.w500, color: Colors.white), placeholderTextStyle: TextStyle( - color: Theme.of(context).primaryTextTheme!.headlineSmall!.decorationColor!, + color: Theme.of(context).extension()!.textFieldHintColor, fontWeight: FontWeight.w500, fontSize: 36, ), @@ -181,7 +177,7 @@ class PreOrderPage extends BasePage { S.of(context).buy_with + ':', textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context).primaryTextTheme.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, fontSize: 18, fontWeight: FontWeight.bold ), @@ -248,7 +244,7 @@ class PreOrderPage extends BasePage { ? S.of(context).buy : S.of(context).buy_with + ' ${buyViewModel.selectedProvider!.description.title}', - color: Theme.of(context).accentTextTheme!.bodyLarge!.color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, isLoading: buyViewModel.isRunning, isDisabled: (buyViewModel.selectedProvider == null) || diff --git a/lib/src/screens/contact/contact_list_page.dart b/lib/src/screens/contact/contact_list_page.dart index 601133c56..6c00b64f9 100644 --- a/lib/src/screens/contact/contact_list_page.dart +++ b/lib/src/screens/contact/contact_list_page.dart @@ -1,6 +1,7 @@ import 'package:cake_wallet/core/auth_service.dart'; import 'package:cake_wallet/entities/contact_base.dart'; import 'package:cake_wallet/entities/contact_record.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:cake_wallet/utils/show_bar.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:flutter/material.dart'; @@ -32,13 +33,13 @@ class ContactListPage extends BasePage { height: 32.0, decoration: BoxDecoration( shape: BoxShape.circle, - color: Theme.of(context).accentTextTheme!.bodySmall!.color!), + color: Theme.of(context).extension()!.buttonBackgroundColor), child: Stack( alignment: Alignment.center, children: [ Icon( Icons.add, - color: Theme.of(context).primaryTextTheme.titleLarge!.color!, + color: Theme.of(context).dialogTheme.backgroundColor, size: 22.0, ), ButtonTheme( @@ -48,17 +49,15 @@ class ContactListPage extends BasePage { // FIX-ME: Style //shape: CircleBorder(), onPressed: () async { - if (contactListViewModel - .shouldRequireTOTP2FAForAddingContacts) { + if (contactListViewModel.shouldRequireTOTP2FAForAddingContacts) { authService.authenticateAction( context, route: Routes.addressBookAddContact, - conditionToDetermineIfToUse2FA: contactListViewModel - .shouldRequireTOTP2FAForAddingContacts, + conditionToDetermineIfToUse2FA: + contactListViewModel.shouldRequireTOTP2FAForAddingContacts, ); } else { - await Navigator.of(context) - .pushNamed(Routes.addressBookAddContact); + await Navigator.of(context).pushNamed(Routes.addressBookAddContact); } }, child: Offstage()), @@ -77,12 +76,8 @@ class ContactListPage extends BasePage { final contacts = contactListViewModel.contactsToShow; final walletContacts = contactListViewModel.walletContactsToShow; return CollapsibleSectionList( - context: context, sectionCount: 2, - themeColor: Theme.of(context).primaryTextTheme.titleLarge!.color!, - dividerThemeColor: - Theme.of(context).primaryTextTheme.bodySmall!.decorationColor!, - sectionTitleBuilder: (_, int sectionIndex) { + sectionTitleBuilder: (int sectionIndex) { var title = S.current.contact_list_contacts; if (sectionIndex == 0) { @@ -95,7 +90,7 @@ class ContactListPage extends BasePage { }, itemCounter: (int sectionIndex) => sectionIndex == 0 ? walletContacts.length : contacts.length, - itemBuilder: (_, sectionIndex, index) { + itemBuilder: (int sectionIndex, index) { if (sectionIndex == 0) { final walletInfo = walletContacts[index]; return generateRaw(context, walletInfo); @@ -128,8 +123,7 @@ class ContactListPage extends BasePage { return; } - final isCopied = await showNameAndAddressDialog( - context, contact.name, contact.address); + final isCopied = await showNameAndAddressDialog(context, contact.name, contact.address); if (isCopied) { await Clipboard.setData(ClipboardData(text: contact.address)); @@ -152,7 +146,7 @@ class ContactListPage extends BasePage { style: TextStyle( fontSize: 14, fontWeight: FontWeight.normal, - color: Theme.of(context).primaryTextTheme.titleLarge!.color!, + color: Theme.of(context).dialogTheme.backgroundColor, ), ), )) @@ -177,8 +171,7 @@ class ContactListPage extends BasePage { false; } - Future showNameAndAddressDialog( - BuildContext context, String name, String address) async { + Future showNameAndAddressDialog(BuildContext context, String name, String address) async { return await showPopUp( context: context, builder: (BuildContext context) { @@ -193,8 +186,7 @@ class ContactListPage extends BasePage { false; } - ActionPane _actionPane(BuildContext context, ContactRecord contact) => - ActionPane( + ActionPane _actionPane(BuildContext context, ContactRecord contact) => ActionPane( motion: const ScrollMotion(), extentRatio: 0.4, children: [ diff --git a/lib/src/screens/contact/contact_page.dart b/lib/src/screens/contact/contact_page.dart index fc9c6c109..099be41d5 100644 --- a/lib/src/screens/contact/contact_page.dart +++ b/lib/src/screens/contact/contact_page.dart @@ -1,5 +1,6 @@ import 'package:cake_wallet/core/address_validator.dart'; import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cw_core/currency.dart'; import 'package:flutter/material.dart'; @@ -17,6 +18,8 @@ import 'package:cake_wallet/src/widgets/address_text_field.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart'; +import 'package:cake_wallet/themes/extensions/address_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; class ContactPage extends BasePage { ContactPage(this.contactViewModel) @@ -47,7 +50,7 @@ class ContactPage extends BasePage { @override Widget body(BuildContext context) { final downArrow = Image.asset('assets/images/arrow_bottom_purple_icon.png', - color: Theme.of(context).primaryTextTheme!.labelSmall!.color!, + color: Theme.of(context).extension()!.detailsTitlesColor, height: 8); reaction((_) => contactViewModel.state, (ExecutionState state) { @@ -99,15 +102,9 @@ class ContactPage extends BasePage { AddressTextFieldOption.paste, AddressTextFieldOption.qrCode, ], - buttonColor: Theme.of(context) - .accentTextTheme! - .displaySmall! - .color!, + buttonColor: Theme.of(context).extension()!.actionButtonColor, iconColor: PaletteDark.gray, - borderColor: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .backgroundColor!, + borderColor: Theme.of(context).extension()!.textfieldUnderlineColor, validator: AddressValidator(type: contactViewModel.currency!), ), @@ -143,10 +140,7 @@ class ContactPage extends BasePage { await contactViewModel.save(); }, text: S.of(context).save, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, isDisabled: !contactViewModel.isReady))) ], diff --git a/lib/src/screens/dashboard/dashboard_page.dart b/lib/src/screens/dashboard/dashboard_page.dart index ff9f85784..a1db0860b 100644 --- a/lib/src/screens/dashboard/dashboard_page.dart +++ b/lib/src/screens/dashboard/dashboard_page.dart @@ -4,6 +4,8 @@ import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/entities/main_actions.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/market_place_page.dart'; +import 'package:cake_wallet/src/widgets/gradient_background.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; import 'package:cake_wallet/utils/device_info.dart'; import 'package:cake_wallet/utils/version_comparator.dart'; import 'package:cake_wallet/view_model/dashboard/market_place_view_model.dart'; @@ -29,6 +31,8 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:smooth_page_indicator/smooth_page_indicator.dart'; import 'package:cake_wallet/main.dart'; import 'package:cake_wallet/src/screens/release_notes/release_notes_screen.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; class DashboardPage extends StatelessWidget { DashboardPage({ @@ -81,28 +85,11 @@ class _DashboardPageView extends BasePage { final BalancePage balancePage; @override - Color get backgroundLightColor => - currentTheme.type == ThemeType.bright ? Colors.transparent : Colors.white; - - @override - Color get backgroundDarkColor => Colors.transparent; + bool get gradientBackground => true; @override Widget Function(BuildContext, Widget) get rootWrapper => - (BuildContext context, Widget scaffold) => Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - Theme.of(context).colorScheme.secondary, - Theme.of(context).scaffoldBackgroundColor, - Theme.of(context).primaryColor, - ], - begin: Alignment.topRight, - end: Alignment.bottomLeft, - ), - ), - child: scaffold, - ); + (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold); @override bool get resizeToAvoidBottomInset => false; @@ -199,8 +186,10 @@ class _DashboardPageView extends BasePage { dotWidth: 6.0, dotHeight: 6.0, dotColor: Theme.of(context).indicatorColor, - activeDotColor: - Theme.of(context).accentTextTheme.headlineMedium!.backgroundColor!, + activeDotColor: Theme.of(context) + .extension()! + .indicatorDotTheme + .activeIndicatorColor, ), ), ); @@ -216,12 +205,11 @@ class _DashboardPageView extends BasePage { decoration: BoxDecoration( borderRadius: BorderRadius.circular(50.0), border: Border.all( - color: currentTheme.type == ThemeType.bright - ? Color.fromRGBO(255, 255, 255, 0.2) - : Colors.transparent, + color: Theme.of(context).extension()!.cardBorderColor, width: 1, ), - color: Theme.of(context).textTheme.titleLarge!.backgroundColor!, + color: + Theme.of(context).extension()!.syncedBackgroundColor, ), child: Container( padding: EdgeInsets.only(left: 32, right: 32), @@ -240,13 +228,11 @@ class _DashboardPageView extends BasePage { width: 24, color: action.isEnabled?.call(dashboardViewModel) ?? true ? Theme.of(context) - .accentTextTheme - .displayMedium! - .backgroundColor! + .extension()! + .mainActionsIconColor : Theme.of(context) - .accentTextTheme - .displaySmall! - .backgroundColor!, + .extension()! + .labelTextColor, ), title: action.name(context), onClick: () async => @@ -254,9 +240,8 @@ class _DashboardPageView extends BasePage { textColor: action.isEnabled?.call(dashboardViewModel) ?? true ? null : Theme.of(context) - .accentTextTheme - .displaySmall! - .backgroundColor!, + .extension()! + .labelTextColor, ), ), ) 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 6e6db72cc..7e9b2b23d 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_action_button.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_action_button.dart @@ -1,4 +1,7 @@ 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:flutter/material.dart'; class DesktopActionButton extends StatelessWidget { @@ -30,7 +33,7 @@ class DesktopActionButton extends StatelessWidget { width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15.0), - color: Theme.of(context).textTheme!.titleLarge!.backgroundColor!, + color: Theme.of(context).extension()!.syncedBackgroundColor, ), child: Center( child: Row( @@ -41,14 +44,8 @@ class DesktopActionButton extends StatelessWidget { height: 30, width: 30, color: isEnabled - ? Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor! - : Theme.of(context) - .accentTextTheme! - .displaySmall! - .backgroundColor!, + ? Theme.of(context).extension()!.textColor + : Theme.of(context).extension()!.labelTextColor, ), const SizedBox(width: 10), AutoSizeText( @@ -58,10 +55,7 @@ class DesktopActionButton extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.bold, color: isEnabled - ? Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor! + ? Theme.of(context).extension()!.textColor : null, height: 1, ), diff --git a/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart b/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart index 74ad54870..8119e9fd4 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; class SideMenuItem extends StatelessWidget { const SideMenuItem({ @@ -16,7 +17,7 @@ class SideMenuItem extends StatelessWidget { Color _setColor(BuildContext context) { if (isSelected) { - return Theme.of(context).primaryTextTheme!.titleLarge!.color!; + return Theme.of(context).extension()!.titleColor; } else { return Theme.of(context).highlightColor; } diff --git a/lib/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart b/lib/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart index 089987d5d..684f7cd08 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart @@ -1,10 +1,12 @@ import 'package:another_flushbar/flushbar.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/core/auth_service.dart'; import 'package:cake_wallet/entities/desktop_dropdown_item.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/dropdown_item_widget.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; import 'package:cake_wallet/utils/show_bar.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart'; @@ -37,14 +39,14 @@ class _DesktopWalletSelectionDropDownState extends State()!.titleColor, ); Image _restoreWalletImage(BuildContext context) => Image.asset( 'assets/images/restore_wallet.png', height: 12, width: 12, - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ); Flushbar? _progressBar; @@ -94,8 +96,8 @@ class _DesktopWalletSelectionDropDownState extends State()!.backgroundColor, + style: TextStyle(color: themeData.extension()!.titleColor), selectedItemBuilder: (context) => dropDownItems.map((item) => item.child).toList(), value: dropDownItems.firstWhere((element) => element.isSelected), underline: const SizedBox(), diff --git a/lib/src/screens/dashboard/desktop_widgets/dropdown_item_widget.dart b/lib/src/screens/dashboard/desktop_widgets/dropdown_item_widget.dart index 14dcbb0d8..aa7012ae5 100644 --- a/lib/src/screens/dashboard/desktop_widgets/dropdown_item_widget.dart +++ b/lib/src/screens/dashboard/desktop_widgets/dropdown_item_widget.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; class DropDownItemWidget extends StatelessWidget { @@ -23,7 +24,7 @@ class DropDownItemWidget extends StatelessWidget { style: TextStyle( fontSize: 22, fontWeight: FontWeight.w500, - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), overflow: TextOverflow.ellipsis, maxLines: 1, diff --git a/lib/src/screens/dashboard/edit_token_page.dart b/lib/src/screens/dashboard/edit_token_page.dart index 9d1abc893..50bcb24e1 100644 --- a/lib/src/screens/dashboard/edit_token_page.dart +++ b/lib/src/screens/dashboard/edit_token_page.dart @@ -6,6 +6,7 @@ import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/src/widgets/checkbox_widget.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; import 'package:cake_wallet/view_model/dashboard/home_settings_view_model.dart'; import 'package:cw_core/erc20_token.dart'; import 'package:flutter/material.dart'; @@ -111,7 +112,7 @@ class _EditTokenPageBodyState extends State { Container( padding: EdgeInsets.symmetric(vertical: 16, horizontal: 28), decoration: BoxDecoration( - color: Theme.of(context).accentTextTheme.bodySmall!.color!, + color: Theme.of(context).cardColor, borderRadius: BorderRadius.circular(12), ), child: Row( @@ -128,7 +129,7 @@ class _EditTokenPageBodyState extends State { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context).primaryTextTheme.titleLarge!.color!, + color: Theme.of(context).dialogTheme.backgroundColor, ), ), Padding( @@ -138,7 +139,7 @@ class _EditTokenPageBodyState extends State { style: TextStyle( fontSize: 14, fontWeight: FontWeight.normal, - color: Theme.of(context).primaryTextTheme.labelSmall!.color!, + color: Theme.of(context).extension()!.detailsTitlesColor, ), ), ), @@ -197,7 +198,7 @@ class _EditTokenPageBodyState extends State { } }, text: S.of(context).save, - color: Theme.of(context).accentTextTheme.bodyLarge!.color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), ), diff --git a/lib/src/screens/dashboard/home_settings_page.dart b/lib/src/screens/dashboard/home_settings_page.dart index c6b005bde..9303cb053 100644 --- a/lib/src/screens/dashboard/home_settings_page.dart +++ b/lib/src/screens/dashboard/home_settings_page.dart @@ -7,6 +7,8 @@ import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/settings/widgets/settings_picker_cell.dart'; import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart'; +import 'package:cake_wallet/themes/extensions/address_theme.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; import 'package:cake_wallet/view_model/dashboard/home_settings_view_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; @@ -34,7 +36,7 @@ class HomeSettingsPage extends BasePage { onItemSelected: _homeSettingsViewModel.setSortBalanceBy, ), ), - Divider(color: Theme.of(context).primaryTextTheme.bodySmall!.decorationColor!), + Divider(color: Theme.of(context).extension()!.dividerColor), Observer( builder: (_) => SettingsSwitcherCell( title: S.of(context).pin_at_top(_homeSettingsViewModel.nativeToken.title), @@ -44,7 +46,7 @@ class HomeSettingsPage extends BasePage { }, ), ), - Divider(color: Theme.of(context).primaryTextTheme.bodySmall!.decorationColor!), + Divider(color: Theme.of(context).extension()!.dividerColor), const SizedBox(height: 20), Row( children: [ @@ -53,12 +55,12 @@ class HomeSettingsPage extends BasePage { padding: const EdgeInsetsDirectional.only(start: 16), child: TextFormField( controller: _searchController, - style: TextStyle(color: Theme.of(context).primaryTextTheme.titleLarge!.color!), + style: TextStyle(color: Theme.of(context).dialogTheme.backgroundColor), decoration: InputDecoration( hintText: S.of(context).search_add_token, prefixIcon: Image.asset("assets/images/search_icon.png"), filled: true, - fillColor: Theme.of(context).accentTextTheme.displaySmall!.color!, + fillColor: Theme.of(context).extension()!.actionButtonColor, alignLabelWithHint: false, contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16), enabledBorder: OutlineInputBorder( @@ -84,15 +86,15 @@ class HomeSettingsPage extends BasePage { }); }, elevation: 0, - fillColor: Theme.of(context).accentTextTheme.bodySmall!.color!, + fillColor: Theme.of(context).cardColor, child: Icon( Icons.add, - color: Theme.of(context).primaryTextTheme.titleLarge!.color!, + color: Theme.of(context).dialogTheme.backgroundColor, size: 22.0, ), padding: EdgeInsets.all(12), shape: CircleBorder(), - splashColor: Theme.of(context).accentTextTheme.bodySmall!.color!, + splashColor: Theme.of(context).cardColor, ), ], ), @@ -146,7 +148,7 @@ class HomeSettingsPage extends BasePage { ), ), decoration: BoxDecoration( - color: Theme.of(context).accentTextTheme.bodySmall!.color!, + color: Theme.of(context).cardColor, borderRadius: BorderRadius.circular(30), ), ); diff --git a/lib/src/screens/dashboard/widgets/action_button.dart b/lib/src/screens/dashboard/widgets/action_button.dart index a3626fe3f..23f5c2f93 100644 --- a/lib/src/screens/dashboard/widgets/action_button.dart +++ b/lib/src/screens/dashboard/widgets/action_button.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; class ActionButton extends StatelessWidget { ActionButton( @@ -46,14 +47,11 @@ class ActionButton extends StatelessWidget { style: TextStyle( fontSize: 10, color: textColor ?? - Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!), + Theme.of(context).extension()!.cardTextColor), ) ], ), ), ); } -} \ No newline at end of file +} diff --git a/lib/src/screens/dashboard/widgets/address_page.dart b/lib/src/screens/dashboard/widgets/address_page.dart index 18f85fa07..9d97c4e4f 100644 --- a/lib/src/screens/dashboard/widgets/address_page.dart +++ b/lib/src/screens/dashboard/widgets/address_page.dart @@ -1,10 +1,15 @@ +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/anonpay/anonpay_donation_link_info.dart'; import 'package:cake_wallet/entities/preferences_key.dart'; import 'package:cake_wallet/entities/receive_page_option.dart'; import 'package:cake_wallet/src/screens/base_page.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/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/theme_base.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cake_wallet/utils/share_util.dart'; @@ -21,6 +26,8 @@ import 'package:keyboard_actions/keyboard_actions.dart'; import 'package:mobx/mobx.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:cake_wallet/di.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; class AddressPage extends BasePage { AddressPage({ @@ -48,11 +55,7 @@ class AddressPage extends BasePage { final FocusNode _cryptoAmountFocus; @override - Color get backgroundLightColor => - currentTheme.type == ThemeType.bright ? Colors.transparent : Colors.white; - - @override - Color get backgroundDarkColor => Colors.transparent; + bool get gradientBackground => true; @override bool get resizeToAvoidBottomInset => false; @@ -84,7 +87,7 @@ class AddressPage extends BasePage { overlayColor: MaterialStateColor.resolveWith((states) => Colors.transparent), ), onPressed: () => onClose(context), - child: !isMobileView ? _closeButton : _backButton, + child: !isMobileView ? closeButton(context) : backButton(context), ), ), ), @@ -94,20 +97,11 @@ class AddressPage extends BasePage { @override Widget middle(BuildContext context) => PresentReceiveOptionPicker( - receiveOptionViewModel: receiveOptionViewModel, - hasWhiteBackground: currentTheme.type == ThemeType.light, - ); + color: titleColor(context), receiveOptionViewModel: receiveOptionViewModel); @override Widget Function(BuildContext, Widget) get rootWrapper => - (BuildContext context, Widget scaffold) => Container( - decoration: BoxDecoration( - gradient: LinearGradient(colors: [ - Theme.of(context).colorScheme.secondary, - Theme.of(context).scaffoldBackgroundColor, - Theme.of(context).primaryColor, - ], begin: Alignment.topRight, end: Alignment.bottomLeft)), - child: scaffold); + (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold); @override Widget? trailing(BuildContext context) { @@ -201,8 +195,13 @@ class AddressPage extends BasePage { decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(25)), border: Border.all( - color: Theme.of(context).textTheme.titleMedium!.color!, width: 1), - color: Theme.of(context).textTheme.titleLarge!.backgroundColor!), + color: Theme.of(context) + .extension()! + .iconsBackgroundColor, + width: 1), + color: Theme.of(context) + .extension()! + .syncedBackgroundColor), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -215,15 +214,13 @@ class AddressPage extends BasePage { style: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme.displayMedium! - .backgroundColor!), + color: Theme.of(context).extension()!.textColor), )), Icon( Icons.arrow_forward_ios, size: 14, color: - Theme.of(context).accentTextTheme.displayMedium!.backgroundColor!, + Theme.of(context).extension()!.textColor, ) ], ), @@ -234,8 +231,7 @@ class AddressPage extends BasePage { textAlign: TextAlign.center, style: TextStyle( fontSize: 15, - color: - Theme.of(context).accentTextTheme.displaySmall!.backgroundColor!)); + color: Theme.of(context).extension()!.labelTextColor)); } else { return const SizedBox(); } diff --git a/lib/src/screens/dashboard/widgets/anonpay_transaction_row.dart b/lib/src/screens/dashboard/widgets/anonpay_transaction_row.dart index 3b33e8e22..cb8bef0b7 100644 --- a/lib/src/screens/dashboard/widgets/anonpay_transaction_row.dart +++ b/lib/src/screens/dashboard/widgets/anonpay_transaction_row.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; class AnonpayTransactionRow extends StatelessWidget { AnonpayTransactionRow({ @@ -37,19 +39,19 @@ class AnonpayTransactionRow extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!)), + color: Theme.of(context).extension()!.textColor)), Text(amount + ' ' + currency, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!)) + color: Theme.of(context).extension()!.textColor)) ]), SizedBox(height: 5), Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(createdAt, style: TextStyle( fontSize: 14, - color: Theme.of(context).textTheme!.labelSmall!.backgroundColor!)) + color: Theme.of(context).extension()!.dateSectionRowColor)) ]) ], )) diff --git a/lib/src/screens/dashboard/widgets/balance_page.dart b/lib/src/screens/dashboard/widgets/balance_page.dart index 0fc0f8112..f799950ea 100644 --- a/lib/src/screens/dashboard/widgets/balance_page.dart +++ b/lib/src/screens/dashboard/widgets/balance_page.dart @@ -1,6 +1,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/theme_base.dart'; import 'package:cake_wallet/utils/feature_flag.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; @@ -10,6 +11,8 @@ import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:auto_size_text/auto_size_text.dart'; 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'; class BalancePage extends StatelessWidget { BalancePage({required this.dashboardViewModel, required this.settingsStore}); @@ -41,7 +44,8 @@ class BalancePage extends StatelessWidget { fontSize: 24, fontFamily: 'Lato', fontWeight: FontWeight.w600, - color: Theme.of(context).accentTextTheme.displayMedium!.backgroundColor!, + color: + Theme.of(context).extension()!.pageTitleTextColor, height: 1, ), maxLines: 1, @@ -55,8 +59,9 @@ class BalancePage extends StatelessWidget { padding: const EdgeInsets.all(8.0), child: Image.asset( 'assets/images/home_screen_settings_icon.png', - color: - Theme.of(context).accentTextTheme.displayMedium!.backgroundColor!, + color: Theme.of(context) + .extension()! + .pageTitleTextColor, ), ), ), @@ -139,7 +144,7 @@ class BalancePage extends StatelessWidget { : Colors.transparent, width: 1, ), - color: Theme.of(context).textTheme.titleLarge!.backgroundColor!, + color: Theme.of(context).extension()!.syncedBackgroundColor, ), child: Container( margin: const EdgeInsets.only(top: 16, left: 24, right: 24, bottom: 24), @@ -164,9 +169,8 @@ class BalancePage extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.w400, color: Theme.of(context) - .accentTextTheme! - .displaySmall! - .backgroundColor!, + .extension()! + .labelTextColor, height: 1)), if (hasAdditionalBalance) Padding( @@ -174,9 +178,8 @@ class BalancePage extends StatelessWidget { child: Icon(Icons.help_outline, size: 16, color: Theme.of(context) - .accentTextTheme! - .displaySmall! - .backgroundColor!), + .extension()! + .labelTextColor), ), ], ), @@ -187,9 +190,8 @@ class BalancePage extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.w900, color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + .extension()! + .balanceAmountColor, height: 1), maxLines: 1, textAlign: TextAlign.start), @@ -200,10 +202,7 @@ class BalancePage extends StatelessWidget { fontSize: 16, fontFamily: 'Lato', fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.textColor, height: 1)), ], ), @@ -213,7 +212,7 @@ class BalancePage extends StatelessWidget { fontSize: 28, fontFamily: 'Lato', fontWeight: FontWeight.w800, - color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!, + color: Theme.of(context).extension()!.assetTitleColor, height: 1)), ], ), @@ -229,7 +228,7 @@ class BalancePage extends StatelessWidget { fontSize: 12, fontFamily: 'Lato', fontWeight: FontWeight.w400, - color: Theme.of(context).accentTextTheme.displaySmall!.backgroundColor!, + color: Theme.of(context).extension()!.labelTextColor, height: 1, ), ), @@ -240,7 +239,7 @@ class BalancePage extends StatelessWidget { fontSize: 20, fontFamily: 'Lato', fontWeight: FontWeight.w400, - color: Theme.of(context).accentTextTheme.displayMedium!.backgroundColor!, + color: Theme.of(context).extension()!.textColor, height: 1, ), maxLines: 1, @@ -254,7 +253,7 @@ class BalancePage extends StatelessWidget { fontSize: 12, fontFamily: 'Lato', fontWeight: FontWeight.w400, - color: Theme.of(context).accentTextTheme.displayMedium!.backgroundColor!, + color: Theme.of(context).extension()!.textColor, height: 1, ), ), @@ -272,7 +271,7 @@ class BalancePage extends StatelessWidget { fontSize: 12, fontFamily: 'Lato', fontWeight: FontWeight.w400, - color: Theme.of(context).accentTextTheme.displaySmall!.backgroundColor!, + color: Theme.of(context).extension()!.labelTextColor, height: 1, ), ), @@ -283,7 +282,7 @@ class BalancePage extends StatelessWidget { fontSize: 20, fontFamily: 'Lato', fontWeight: FontWeight.w400, - color: Theme.of(context).accentTextTheme.displayMedium!.backgroundColor!, + color: Theme.of(context).extension()!.textColor, height: 1, ), maxLines: 1, @@ -297,7 +296,7 @@ class BalancePage extends StatelessWidget { fontSize: 12, fontFamily: 'Lato', fontWeight: FontWeight.w400, - color: Theme.of(context).accentTextTheme.displayMedium!.backgroundColor!, + color: Theme.of(context).extension()!.textColor, height: 1, ), ), diff --git a/lib/src/screens/dashboard/widgets/date_section_raw.dart b/lib/src/screens/dashboard/widgets/date_section_raw.dart index 7abaa0ba7..73f9f03a1 100644 --- a/lib/src/screens/dashboard/widgets/date_section_raw.dart +++ b/lib/src/screens/dashboard/widgets/date_section_raw.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:intl/intl.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/utils/date_formatter.dart'; @@ -36,9 +37,6 @@ class DateSectionRaw extends StatelessWidget { child: Text(title, style: TextStyle( fontSize: 12, - color: Theme.of(context) - .textTheme! - .labelSmall! - .backgroundColor!))); + color: Theme.of(context).extension()!.dateSectionRowColor))); } } diff --git a/lib/src/screens/dashboard/widgets/filter_widget.dart b/lib/src/screens/dashboard/widgets/filter_widget.dart index da13208bc..ec867ae49 100644 --- a/lib/src/screens/dashboard/widgets/filter_widget.dart +++ b/lib/src/screens/dashboard/widgets/filter_widget.dart @@ -1,12 +1,15 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/filter_tile.dart'; import 'package:cake_wallet/src/widgets/section_divider.dart'; import 'package:cake_wallet/src/widgets/standard_checkbox.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/src/widgets/picker_wrapper_widget.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; //import 'package:date_range_picker/date_range_picker.dart' as date_rage_picker; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class FilterWidget extends StatelessWidget { FilterWidget({required this.dashboardViewModel}); @@ -15,7 +18,7 @@ class FilterWidget extends StatelessWidget { @override Widget build(BuildContext context) { - const sectionDivider = const SectionDivider(); + const sectionDivider = const HorizontalSectionDivider(); return PickerWrapperWidget( children: [ Padding( @@ -23,7 +26,7 @@ class FilterWidget extends StatelessWidget { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(24)), child: Container( - color: Theme.of(context).textTheme!.bodyLarge!.decorationColor!, + color: Theme.of(context).extension()!.backgroundColor, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -32,10 +35,7 @@ class FilterWidget extends StatelessWidget { child: Text( S.of(context).filter_by, style: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .labelSmall! - .color!, + color: Theme.of(context).extension()!.detailsTitlesColor, fontSize: 16, fontFamily: 'Lato', decoration: TextDecoration.none, @@ -63,10 +63,7 @@ class FilterWidget extends StatelessWidget { child: Text( title, style: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!, + color: Theme.of(context).extension()!.titleColor, fontSize: 16, fontFamily: 'Lato', fontWeight: FontWeight.bold, diff --git a/lib/src/screens/dashboard/widgets/header_row.dart b/lib/src/screens/dashboard/widgets/header_row.dart index 44fdb6c59..79b7b3fe6 100644 --- a/lib/src/screens/dashboard/widgets/header_row.dart +++ b/lib/src/screens/dashboard/widgets/header_row.dart @@ -1,8 +1,10 @@ import 'package:cake_wallet/src/screens/dashboard/widgets/filter_widget.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; class HeaderRow extends StatelessWidget { HeaderRow({required this.dashboardViewModel}); @@ -12,7 +14,7 @@ class HeaderRow extends StatelessWidget { @override Widget build(BuildContext context) { final filterIcon = Image.asset('assets/images/filter_icon.png', - color: Theme.of(context).textTheme!.bodySmall!.decorationColor!); + color: Theme.of(context).extension()!.iconColor); return Container( height: 52, @@ -27,10 +29,7 @@ class HeaderRow extends StatelessWidget { style: TextStyle( fontSize: 20, fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!), + color: Theme.of(context).extension()!.pageTitleTextColor), ), GestureDetector( onTap: () { @@ -45,7 +44,7 @@ class HeaderRow extends StatelessWidget { width: 36, decoration: BoxDecoration( shape: BoxShape.circle, - color: Theme.of(context).textTheme!.labelSmall!.color!), + color: Theme.of(context).extension()!.buttonColor), child: filterIcon, ), ) diff --git a/lib/src/screens/dashboard/widgets/market_place_page.dart b/lib/src/screens/dashboard/widgets/market_place_page.dart index eeed4bee0..2d6539370 100644 --- a/lib/src/screens/dashboard/widgets/market_place_page.dart +++ b/lib/src/screens/dashboard/widgets/market_place_page.dart @@ -8,6 +8,7 @@ import 'package:cw_core/wallet_type.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; class MarketPlacePage extends StatelessWidget { MarketPlacePage({ @@ -40,10 +41,7 @@ class MarketPlacePage extends StatelessWidget { style: TextStyle( fontSize: 24, fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.pageTitleTextColor, ), ), Expanded( diff --git a/lib/src/screens/dashboard/widgets/menu_widget.dart b/lib/src/screens/dashboard/widgets/menu_widget.dart index 9dd08add9..6303d587a 100644 --- a/lib/src/screens/dashboard/widgets/menu_widget.dart +++ b/lib/src/screens/dashboard/widgets/menu_widget.dart @@ -1,13 +1,12 @@ import 'package:cake_wallet/src/widgets/setting_action_button.dart'; import 'package:cake_wallet/src/widgets/setting_actions.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:cw_core/wallet_type.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; -// FIXME: terrible design. - class MenuWidget extends StatefulWidget { MenuWidget(this.dashboardViewModel); @@ -19,18 +18,18 @@ class MenuWidget extends StatefulWidget { class MenuWidgetState extends State { MenuWidgetState() - : this.menuWidth = 0, - this.screenWidth = 0, - this.screenHeight = 0, - this.headerHeight = 120, - this.tileHeight = 60, - this.fromTopEdge = 50, - this.fromBottomEdge = 25, - this.moneroIcon = Image.asset('assets/images/monero_menu.png'), - this.bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png'), - this.litecoinIcon = Image.asset('assets/images/litecoin_menu.png'), - this.havenIcon = Image.asset('assets/images/haven_menu.png'), - this.ethereumIcon = Image.asset('assets/images/eth_icon.png'); + : this.menuWidth = 0, + this.screenWidth = 0, + this.screenHeight = 0, + this.headerHeight = 120, + this.tileHeight = 60, + this.fromTopEdge = 50, + this.fromBottomEdge = 25, + this.moneroIcon = Image.asset('assets/images/monero_menu.png'), + this.bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png'), + this.litecoinIcon = Image.asset('assets/images/litecoin_menu.png'), + this.havenIcon = Image.asset('assets/images/haven_menu.png'), + this.ethereumIcon = Image.asset('assets/images/eth_icon.png'); final largeScreen = 731; @@ -86,121 +85,111 @@ class MenuWidgetState extends State { final itemCount = SettingActions.all.length; moneroIcon = Image.asset('assets/images/monero_menu.png', - color: Theme.of(context) - .accentTextTheme - .labelSmall! - .decorationColor!); + color: Theme.of(context).extension()!.iconColor); bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png', - color: Theme.of(context) - .accentTextTheme - .labelSmall! - .decorationColor!); + color: Theme.of(context).extension()!.iconColor); return Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ Padding( - padding: EdgeInsets.only(left: 24), - child: Container( - height: 60, - width: 4, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(2)), color: PaletteDark.gray), - )), + padding: EdgeInsets.only(left: 24), + child: Container( + height: 60, + width: 4, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(2)), color: PaletteDark.gray), + ), + ), SizedBox(width: 12), Expanded( - child: ClipRRect( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(24), bottomLeft: Radius.circular(24)), - child: Container( - color: - Theme.of(context).textTheme!.bodyLarge!.decorationColor!, - child: ListView.separated( - padding: EdgeInsets.only(top: 0), - itemBuilder: (_, index) { - if (index == 0) { - return Container( - height: headerHeight, - decoration: BoxDecoration( - gradient: LinearGradient(colors: [ - Theme.of(context) - .accentTextTheme! - .headlineMedium! - .color!, - Theme.of(context) - .accentTextTheme! - .headlineMedium! - .decorationColor!, ], begin: Alignment.topLeft, end: Alignment.bottomRight), - ), - padding: EdgeInsets.only( - left: 24, top: fromTopEdge, right: 24, bottom: fromBottomEdge), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - _iconFor(type: widget.dashboardViewModel.type), - SizedBox(width: 12), - SingleChildScrollView( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: widget.dashboardViewModel.subname.isNotEmpty - ? MainAxisAlignment.spaceBetween - : MainAxisAlignment.center, - children: [ - Text( - widget.dashboardViewModel.name, - style: TextStyle( - color: Colors.white, - fontSize: 16, - fontWeight: FontWeight.bold), - ), - if (widget.dashboardViewModel.subname.isNotEmpty) - Observer( - builder: (_) => Text( - widget.dashboardViewModel.subname, - style: TextStyle( - color: Theme.of(context) - .accentTextTheme! - .labelSmall! - .decorationColor!, - fontWeight: FontWeight.w500, - fontSize: 12), - )) - ], + child: ClipRRect( + borderRadius: + BorderRadius.only(topLeft: Radius.circular(24), bottomLeft: Radius.circular(24)), + child: Container( + color: Theme.of(context).extension()!.backgroundColor, + child: ListView.separated( + padding: EdgeInsets.only(top: 0), + itemBuilder: (_, index) { + if (index == 0) { + return Container( + height: headerHeight, + decoration: BoxDecoration( + gradient: LinearGradient(colors: [ + Theme.of(context).extension()!.headerFirstGradientColor, + Theme.of(context).extension()!.headerSecondGradientColor, + ], begin: Alignment.topLeft, end: Alignment.bottomRight), + ), + padding: EdgeInsets.only( + left: 24, top: fromTopEdge, right: 24, bottom: fromBottomEdge), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + _iconFor(type: widget.dashboardViewModel.type), + SizedBox(width: 12), + SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: widget.dashboardViewModel.subname.isNotEmpty + ? MainAxisAlignment.spaceBetween + : MainAxisAlignment.center, + children: [ + Text( + widget.dashboardViewModel.name, + style: TextStyle( + color: Colors.white, + fontSize: 16, + fontWeight: FontWeight.bold), ), - )) - ], + if (widget.dashboardViewModel.subname.isNotEmpty) + Observer( + builder: (_) => Text( + widget.dashboardViewModel.subname, + style: TextStyle( + color: Theme.of(context) + .extension()! + .subnameTextColor, + fontWeight: FontWeight.w500, + fontSize: 12), + ), + ), + ], + ), ), - ); - } - - index--; - - final item = SettingActions.all[index]; - - final isLastTile = index == itemCount - 1; - - return SettingActionButton( - isLastTile: isLastTile, - tileHeight: tileHeight, - selectionActive: false, - fromBottomEdge: fromBottomEdge, - fromTopEdge: fromTopEdge, - onTap: () => item.onTap.call(context), - image: item.image, - title: item.name.call(context), - ); - }, - separatorBuilder: (_, index) => Container( - height: 1, - color: Theme.of(context) - .primaryTextTheme! - .bodySmall! - .decorationColor!, ), - itemCount: itemCount + 1), - ))) + ], + ), + ); + } + + index--; + + final item = SettingActions.all[index]; + + final isLastTile = index == itemCount - 1; + + return SettingActionButton( + isLastTile: isLastTile, + tileHeight: tileHeight, + selectionActive: false, + fromBottomEdge: fromBottomEdge, + fromTopEdge: fromTopEdge, + onTap: () => item.onTap.call(context), + image: item.image, + title: item.name.call(context), + ); + }, + separatorBuilder: (_, index) => Container( + height: 1, + color: Theme.of(context).extension()!.dividerColor, + ), + itemCount: itemCount + 1, + ), + ), + ), + ), ], ); } diff --git a/lib/src/screens/dashboard/widgets/order_row.dart b/lib/src/screens/dashboard/widgets/order_row.dart index 961f31784..8adc6e0d5 100644 --- a/lib/src/screens/dashboard/widgets/order_row.dart +++ b/lib/src/screens/dashboard/widgets/order_row.dart @@ -1,6 +1,9 @@ import 'package:cake_wallet/buy/buy_provider_description.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/buy/get_buy_provider_icon.dart'; +import 'package:cake_wallet/themes/extensions/order_theme.dart'; import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; class OrderRow extends StatelessWidget { OrderRow({ @@ -20,7 +23,7 @@ class OrderRow extends StatelessWidget { @override Widget build(BuildContext context) { final iconColor = - Theme.of(context).primaryTextTheme!.displayLarge!.backgroundColor!; + Theme.of(context).extension()!.iconColor; final providerIcon = getBuyProviderIcon(provider, iconColor: iconColor); @@ -48,14 +51,14 @@ class OrderRow extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor! + color: Theme.of(context).extension()!.textColor )), formattedAmount != null ? Text(formattedAmount! + ' ' + to, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor! + color: Theme.of(context).extension()!.textColor )) : Container() ]), @@ -66,10 +69,7 @@ class OrderRow extends StatelessWidget { Text(createdAtFormattedDate, style: TextStyle( fontSize: 14, - color: Theme.of(context) - .textTheme! - .labelSmall! - .backgroundColor!)) + color: Theme.of(context).extension()!.dateSectionRowColor)) ]) ], ) diff --git a/lib/src/screens/dashboard/widgets/present_receive_option_picker.dart b/lib/src/screens/dashboard/widgets/present_receive_option_picker.dart index cf2ae7e3d..aae42049b 100644 --- a/lib/src/screens/dashboard/widgets/present_receive_option_picker.dart +++ b/lib/src/screens/dashboard/widgets/present_receive_option_picker.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/screens/ionia/widgets/rounded_checkbox.dart'; import 'package:cake_wallet/src/widgets/alert_background.dart'; @@ -10,22 +11,16 @@ import 'package:cake_wallet/generated/i18n.dart'; class PresentReceiveOptionPicker extends StatelessWidget { PresentReceiveOptionPicker( - {required this.receiveOptionViewModel, this.hasWhiteBackground = false}); + {required this.receiveOptionViewModel, required this.color}); final ReceiveOptionViewModel receiveOptionViewModel; - final bool hasWhiteBackground; + final Color color; @override Widget build(BuildContext context) { - final textIconTheme = hasWhiteBackground - ? Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor! - : Colors.white; final arrowBottom = Image.asset( 'assets/images/arrow_bottom_purple_icon.png', - color: textIconTheme, + color: color, height: 6, ); @@ -51,14 +46,14 @@ class PresentReceiveOptionPicker extends StatelessWidget { fontSize: 18.0, fontWeight: FontWeight.bold, fontFamily: 'Lato', - color: textIconTheme), + color: color), ), Observer( builder: (_) => Text(receiveOptionViewModel.selectedReceiveOption.toString(), style: TextStyle( fontSize: 10.0, fontWeight: FontWeight.w500, - color: textIconTheme))) + color: color))) ], ), SizedBox(width: 5), @@ -113,10 +108,7 @@ class PresentReceiveOptionPicker extends StatelessWidget { Text(option.toString(), textAlign: TextAlign.left, style: textSmall( - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!, + color: Theme.of(context).extension()!.titleColor, ).copyWith( fontWeight: value == option ? FontWeight.w800 : FontWeight.w500, diff --git a/lib/src/screens/dashboard/widgets/sync_indicator.dart b/lib/src/screens/dashboard/widgets/sync_indicator.dart index 11a973d6e..52e596a83 100644 --- a/lib/src/screens/dashboard/widgets/sync_indicator.dart +++ b/lib/src/screens/dashboard/widgets/sync_indicator.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:cake_wallet/core/sync_status_title.dart'; @@ -32,7 +33,7 @@ class SyncIndicator extends StatelessWidget { child: Container( height: 30, width: syncIndicatorWidth, - color: Theme.of(context).textTheme!.titleLarge!.decorationColor!, + color: Theme.of(context).extension()!.notSyncedBackgroundColor, child: Stack( alignment: Alignment.center, children: [ @@ -44,7 +45,7 @@ class SyncIndicator extends StatelessWidget { child: Container( width: indicatorWidth, height: 30, - color: Theme.of(context).textTheme!.titleLarge!.backgroundColor!, + color: Theme.of(context).extension()!.syncedBackgroundColor, ) ) : Offstage(), @@ -66,7 +67,7 @@ class SyncIndicator extends StatelessWidget { style: TextStyle( fontSize: 12, fontWeight: FontWeight.w500, - color: Theme.of(context).textTheme!.titleLarge!.color! + color: Theme.of(context).extension()!.textColor ), ), ) diff --git a/lib/src/screens/dashboard/widgets/sync_indicator_icon.dart b/lib/src/screens/dashboard/widgets/sync_indicator_icon.dart index 0aa8fa7c5..11bde6dfa 100644 --- a/lib/src/screens/dashboard/widgets/sync_indicator_icon.dart +++ b/lib/src/screens/dashboard/widgets/sync_indicator_icon.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/palette.dart'; @@ -26,7 +28,7 @@ class SyncIndicatorIcon extends StatelessWidget { if (boolMode) { indicatorColor = isSynced ? PaletteDark.brightGreen - : Theme.of(context).textTheme!.bodySmall!.color!; + : Theme.of(context).extension()!.notSyncedIconColor; } else { switch (value.toLowerCase()) { case waiting: @@ -34,7 +36,7 @@ class SyncIndicatorIcon extends StatelessWidget { break; case actionRequired: indicatorColor = - Theme.of(context).textTheme!.displayMedium!.decorationColor!; + Theme.of(context).extension()!.currentTileBackgroundColor; break; case created: indicatorColor = PaletteDark.brightGreen; diff --git a/lib/src/screens/dashboard/widgets/trade_row.dart b/lib/src/screens/dashboard/widgets/trade_row.dart index 754e9d237..a42593f24 100644 --- a/lib/src/screens/dashboard/widgets/trade_row.dart +++ b/lib/src/screens/dashboard/widgets/trade_row.dart @@ -1,6 +1,8 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/exchange_provider_description.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; class TradeRow extends StatelessWidget { TradeRow({ @@ -43,14 +45,14 @@ class TradeRow extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!)), + color: Theme.of(context).extension()!.textColor)), formattedAmount != null ? Text(formattedAmount! + ' ' + amountCrypto, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, color: - Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!)) + Theme.of(context).extension()!.textColor)) : Container() ]), SizedBox(height: 5), @@ -59,7 +61,7 @@ class TradeRow extends StatelessWidget { Text(createdAtFormattedDate!, style: TextStyle( fontSize: 14, - color: Theme.of(context).textTheme!.labelSmall!.backgroundColor!)) + color: Theme.of(context).extension()!.dateSectionRowColor)) ]) ], )) diff --git a/lib/src/screens/dashboard/widgets/transaction_raw.dart b/lib/src/screens/dashboard/widgets/transaction_raw.dart index aae3397ee..3a95b9f2e 100644 --- a/lib/src/screens/dashboard/widgets/transaction_raw.dart +++ b/lib/src/screens/dashboard/widgets/transaction_raw.dart @@ -1,5 +1,8 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; import 'package:cw_core/transaction_direction.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class TransactionRow extends StatelessWidget { TransactionRow( @@ -35,7 +38,7 @@ class TransactionRow extends StatelessWidget { width: 36, decoration: BoxDecoration( shape: BoxShape.circle, - color: Theme.of(context).textTheme!.labelSmall!.decorationColor! + color: Theme.of(context).extension()!.rowsColor ), child: Image.asset( direction == TransactionDirection.incoming @@ -54,14 +57,12 @@ class TransactionRow extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme! - .displayMedium!.backgroundColor!)), + color: Theme.of(context).extension()!.textColor)), Text(formattedAmount, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme! - .displayMedium!.backgroundColor!)) + color: Theme.of(context).extension()!.textColor)) ]), SizedBox(height: 5), Row( @@ -70,17 +71,11 @@ class TransactionRow extends StatelessWidget { Text(formattedDate, style: TextStyle( fontSize: 14, - color: Theme.of(context) - .textTheme! - .labelSmall! - .backgroundColor!)), + color: Theme.of(context).extension()!.dateSectionRowColor)), Text(formattedFiatAmount, style: TextStyle( fontSize: 14, - color: Theme.of(context) - .textTheme! - .labelSmall! - .backgroundColor!)) + color: Theme.of(context).extension()!.dateSectionRowColor)) ]) ], ) diff --git a/lib/src/screens/dashboard/widgets/transactions_page.dart b/lib/src/screens/dashboard/widgets/transactions_page.dart index 644d7b421..3f6b8a3c6 100644 --- a/lib/src/screens/dashboard/widgets/transactions_page.dart +++ b/lib/src/screens/dashboard/widgets/transactions_page.dart @@ -1,5 +1,6 @@ import 'package:cake_wallet/src/screens/dashboard/widgets/anonpay_transaction_row.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/order_row.dart'; +import 'package:cake_wallet/themes/extensions/placeholder_theme.dart'; import 'package:cake_wallet/src/widgets/dashboard_card_widget.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cake_wallet/view_model/dashboard/anonpay_transaction_list_item.dart'; @@ -155,10 +156,7 @@ class TransactionsPage extends StatelessWidget { S.of(context).placeholder_transactions, style: TextStyle( fontSize: 14, - color: Theme.of(context) - .primaryTextTheme - .labelSmall! - .decorationColor!), + color: Theme.of(context).extension()!.color), ), ); })) diff --git a/lib/src/screens/disclaimer/disclaimer_page.dart b/lib/src/screens/disclaimer/disclaimer_page.dart index 1bb05eca0..3805f6240 100644 --- a/lib/src/screens/disclaimer/disclaimer_page.dart +++ b/lib/src/screens/disclaimer/disclaimer_page.dart @@ -1,6 +1,8 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'dart:ui'; import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/routes.dart'; +import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; @@ -87,10 +89,7 @@ class DisclaimerBodyState extends State { style: TextStyle( fontSize: 20.0, fontWeight: FontWeight.bold, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!), + color: Theme.of(context).extension()!.titleColor), ), ) ], @@ -107,10 +106,7 @@ class DisclaimerBodyState extends State { style: TextStyle( fontSize: 12.0, fontWeight: FontWeight.bold, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!), + color: Theme.of(context).extension()!.titleColor), ), ) ], @@ -126,10 +122,7 @@ class DisclaimerBodyState extends State { style: TextStyle( fontSize: 12.0, fontWeight: FontWeight.normal, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!), + color: Theme.of(context).extension()!.titleColor), )) ], ), @@ -146,10 +139,7 @@ class DisclaimerBodyState extends State { style: TextStyle( fontSize: 14.0, fontWeight: FontWeight.bold, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!), + color: Theme.of(context).extension()!.titleColor), ), ) ], @@ -167,7 +157,7 @@ class DisclaimerBodyState extends State { changenowUrl, textAlign: TextAlign.left, style: TextStyle( - color: Palette.blueCraiola, + color: Theme.of(context).primaryColor, fontSize: 14.0, fontWeight: FontWeight.normal, decoration: TextDecoration.underline), @@ -193,7 +183,8 @@ class DisclaimerBodyState extends State { gradient: LinearGradient( colors: [ Theme.of(context) - .backgroundColor + .colorScheme + .background .withOpacity(0.0), Theme.of(context).colorScheme.background, ], @@ -232,10 +223,7 @@ class DisclaimerBodyState extends State { ), decoration: BoxDecoration( border: Border.all( - color: Theme.of(context) - .primaryTextTheme! - .bodySmall! - .color!, + color: Theme.of(context).extension()!.secondaryTextColor, width: 1.0), borderRadius: BorderRadius.all( Radius.circular(8.0)), @@ -253,10 +241,7 @@ class DisclaimerBodyState extends State { style: TextStyle( fontWeight: FontWeight.bold, fontSize: 14.0, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!), + color: Theme.of(context).extension()!.titleColor), ) ], ), @@ -273,14 +258,8 @@ class DisclaimerBodyState extends State { .popAndPushNamed(Routes.welcome) : null, text: 'Accept', - color: Theme.of(context) - .accentTextTheme! - .titleSmall! - .decorationColor!, - textColor: Theme.of(context) - .accentTextTheme! - .headlineSmall! - .decorationColor!), + color: Theme.of(context).extension()!.createNewWalletButtonBackgroundColor, + textColor: Theme.of(context).extension()!.restoreWalletButtonTextColor), ), ], ], diff --git a/lib/src/screens/exchange/exchange_page.dart b/lib/src/screens/exchange/exchange_page.dart index 53d823f18..98929a692 100644 --- a/lib/src/screens/exchange/exchange_page.dart +++ b/lib/src/screens/exchange/exchange_page.dart @@ -1,8 +1,11 @@ +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; import 'package:cake_wallet/core/auth_service.dart'; import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/src/screens/exchange/widgets/desktop_exchange_cards_section.dart'; import 'package:cake_wallet/src/screens/exchange/widgets/mobile_exchange_cards_section.dart'; import 'package:cake_wallet/src/widgets/add_template_button.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/utils/debounce.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; @@ -78,7 +81,10 @@ class ExchangePage extends BasePage { String get title => S.current.exchange; @override - Color get titleColor => Colors.white; + bool get gradientBackground => true; + + @override + bool get gradientAll => true; @override bool get resizeToAvoidBottomInset => false; @@ -115,7 +121,7 @@ class ExchangePage extends BasePage { Widget? leading(BuildContext context) { final _backButton = Icon( Icons.arrow_back_ios, - color: titleColor, + color: titleColor(context), size: 16, ); final _closeButton = @@ -152,7 +158,7 @@ class ExchangePage extends BasePage { disableScroll: true, config: KeyboardActionsConfig( keyboardActionsPlatform: KeyboardActionsPlatform.IOS, - keyboardBarColor: Theme.of(context).accentTextTheme.bodyLarge!.backgroundColor!, + keyboardBarColor: Theme.of(context).extension()!.keyboardBarColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -205,8 +211,8 @@ class ExchangePage extends BasePage { textAlign: TextAlign.center, style: TextStyle( color: Theme.of(context) - .primaryTextTheme.displayLarge! - .decorationColor!, + .extension()! + .receiveAmountColor, fontWeight: FontWeight.w500, fontSize: 12), ), @@ -625,7 +631,7 @@ class ExchangePage extends BasePage { imageArrow: arrowBottomPurple, currencyButtonColor: Colors.transparent, addressButtonsColor: Theme.of(context).focusColor, - borderColor: Theme.of(context).primaryTextTheme.bodyLarge!.color!, + borderColor: Theme.of(context).extension()!.textFieldBorderTopPanelColor, currencyValueValidator: (value) { return !exchangeViewModel.isFixedRateMode ? AmountValidator( @@ -673,7 +679,7 @@ class ExchangePage extends BasePage { imageArrow: arrowBottomCakeGreen, currencyButtonColor: Colors.transparent, addressButtonsColor: Theme.of(context).focusColor, - borderColor: Theme.of(context).primaryTextTheme.bodyLarge!.decorationColor!, + borderColor: Theme.of(context).extension()!.textFieldBorderBottomPanelColor, currencyValueValidator: (value) { return exchangeViewModel.isFixedRateMode ? AmountValidator( diff --git a/lib/src/screens/exchange/exchange_template_page.dart b/lib/src/screens/exchange/exchange_template_page.dart index ddd2c90b7..62f36a3fd 100644 --- a/lib/src/screens/exchange/exchange_template_page.dart +++ b/lib/src/screens/exchange/exchange_template_page.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; import 'package:cake_wallet/exchange/exchange_provider.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/keyboard_done_button.dart'; @@ -29,10 +31,10 @@ class ExchangeTemplatePage extends BasePage { var _isReactionsSet = false; @override - String get title => S.current.exchange_new_template; + bool get gradientAll => true; @override - Color get titleColor => Colors.white; + String get title => S.current.exchange_new_template; @override bool get extendBodyBehindAppBar => true; @@ -73,10 +75,7 @@ class ExchangeTemplatePage extends BasePage { disableScroll: true, config: KeyboardActionsConfig( keyboardActionsPlatform: KeyboardActionsPlatform.IOS, - keyboardBarColor: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .backgroundColor!, + keyboardBarColor: Theme.of(context).extension()!.keyboardBarColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -101,8 +100,8 @@ class ExchangeTemplatePage extends BasePage { ), gradient: LinearGradient( colors: [ - Theme.of(context).primaryTextTheme!.bodyMedium!.color!, - Theme.of(context).primaryTextTheme!.bodyMedium!.decorationColor!, + Theme.of(context).extension()!.firstGradientBottomPanelColor, + Theme.of(context).extension()!.secondGradientBottomPanelColor, ], stops: [0.35, 1.0], begin: Alignment.topLeft, @@ -120,12 +119,8 @@ class ExchangeTemplatePage extends BasePage { ), gradient: LinearGradient( colors: [ - Theme.of(context) - .primaryTextTheme!.titleSmall! - .color!, - Theme.of(context) - .primaryTextTheme!.titleSmall! - .decorationColor!, + Theme.of(context).extension()!.firstGradientTopPanelColor, + Theme.of(context).extension()!.secondGradientTopPanelColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight), @@ -157,10 +152,8 @@ class ExchangeTemplatePage extends BasePage { imageArrow: arrowBottomPurple, currencyButtonColor: Colors.transparent, addressButtonsColor: - Theme.of(context).focusColor, - borderColor: Theme.of(context) - .primaryTextTheme!.bodyLarge! - .color!, + Theme.of(context).extension()!.textFieldButtonColor, + borderColor: Theme.of(context).extension()!.textFieldBorderBottomPanelColor, currencyValueValidator: AmountValidator( currency: exchangeViewModel.depositCurrency), //addressTextFieldValidator: AddressValidator( @@ -197,10 +190,8 @@ class ExchangeTemplatePage extends BasePage { imageArrow: arrowBottomCakeGreen, currencyButtonColor: Colors.transparent, addressButtonsColor: - Theme.of(context).focusColor, - borderColor: Theme.of(context) - .primaryTextTheme!.bodyLarge! - .decorationColor!, + Theme.of(context).extension()!.textFieldButtonColor, + borderColor: Theme.of(context).extension()!.textFieldBorderBottomPanelColor, currencyValueValidator: AmountValidator( currency: exchangeViewModel.receiveCurrency), //addressTextFieldValidator: AddressValidator( @@ -226,9 +217,7 @@ class ExchangeTemplatePage extends BasePage { description, textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context) - .primaryTextTheme!.displayLarge! - .decorationColor!, + color: Theme.of(context).extension()!.receiveAmountColor, fontWeight: FontWeight.w500, fontSize: 12), ), @@ -256,7 +245,7 @@ class ExchangeTemplatePage extends BasePage { } }, text: S.of(context).save, - color: Colors.green, + color: Theme.of(context).primaryColor, textColor: Colors.white), ]), )) @@ -444,4 +433,4 @@ class ExchangeTemplatePage extends BasePage { key.currentState!.addressController.text = ''; } } -} \ No newline at end of file +} diff --git a/lib/src/screens/exchange/widgets/currency_picker_item_widget.dart b/lib/src/screens/exchange/widgets/currency_picker_item_widget.dart index 3dc0f80e3..03c6fdd47 100644 --- a/lib/src/screens/exchange/widgets/currency_picker_item_widget.dart +++ b/lib/src/screens/exchange/widgets/currency_picker_item_widget.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/palette.dart'; @@ -20,10 +22,7 @@ class PickerItemWidget extends StatelessWidget { return GestureDetector( onTap: onTap, child: Container( - color: Theme.of(context) - .accentTextTheme! - .titleLarge! - .color!, + color: Theme.of(context).dialogTheme.backgroundColor, child: Padding( padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 24), child: Row( @@ -44,10 +43,7 @@ class PickerItemWidget extends StatelessWidget { style: TextStyle( color: isSelected ? Palette.blueCraiola - : Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!, + : Theme.of(context).extension()!.titleColor, fontSize: isSelected ? 16 : 14.0, fontFamily: 'Lato', fontWeight: FontWeight.w600, @@ -65,19 +61,13 @@ class PickerItemWidget extends StatelessWidget { style: TextStyle( fontSize: 7.0, fontFamily: 'Lato', - color: Theme.of(context) - .textTheme! - .bodyMedium! - .color!), + color: Theme.of(context).extension()!.thumbColor), ), ), decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), //border: Border.all(color: ), - color: Theme.of(context) - .textTheme! - .bodyMedium! - .decorationColor!, + color: Theme.of(context).extension()!.trackColor, ), ), ), @@ -86,10 +76,7 @@ class PickerItemWidget extends StatelessWidget { ), if (isSelected) Icon(Icons.check_circle, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!) + color: Theme.of(context).primaryColor) ], ), ), diff --git a/lib/src/screens/exchange/widgets/currency_picker_widget.dart b/lib/src/screens/exchange/widgets/currency_picker_widget.dart index de835fe18..35d0198f2 100644 --- a/lib/src/screens/exchange/widgets/currency_picker_widget.dart +++ b/lib/src/screens/exchange/widgets/currency_picker_widget.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/picker_theme.dart'; import 'package:cw_core/currency.dart'; import 'package:flutter/material.dart'; import 'currency_picker_item_widget.dart'; @@ -20,10 +21,7 @@ class CurrencyPickerWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - color: Theme.of(context) - .accentTextTheme! - .titleLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.dividerColor, child: Scrollbar( controller: _scrollController, child: GridView.builder( diff --git a/lib/src/screens/exchange/widgets/exchange_card.dart b/lib/src/screens/exchange/widgets/exchange_card.dart index ce8928cc6..9c4707529 100644 --- a/lib/src/screens/exchange/widgets/exchange_card.dart +++ b/lib/src/screens/exchange/widgets/exchange_card.dart @@ -1,6 +1,8 @@ import 'package:cake_wallet/entities/contact_base.dart'; +import 'package:cake_wallet/themes/extensions/qr_code_theme.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:cake_wallet/utils/show_bar.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/utils/payment_request.dart'; @@ -12,6 +14,7 @@ import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/src/widgets/address_text_field.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class ExchangeCard extends StatefulWidget { ExchangeCard( @@ -160,7 +163,7 @@ class ExchangeCardState extends State { final copyImage = Image.asset('assets/images/copy_content.png', height: 16, width: 16, - color: Theme.of(context).primaryTextTheme!.displaySmall!.color!); + color: Theme.of(context).extension()!.estimatedFeeColor); return Container( width: double.infinity, @@ -175,7 +178,7 @@ class ExchangeCardState extends State { style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, - color: Theme.of(context).textTheme!.headlineSmall!.color!), + color: Theme.of(context).extension()!.qrCodeColor), ) ], ), @@ -211,10 +214,7 @@ class ExchangeCardState extends State { height: 32, decoration: BoxDecoration( color: widget.addressButtonsColor ?? - Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .color!, + Theme.of(context).extension()!.textFieldButtonColor, borderRadius: BorderRadius.all(Radius.circular(6))), child: Center( @@ -224,10 +224,7 @@ class ExchangeCardState extends State { style: TextStyle( fontSize: 12, fontWeight: FontWeight.bold, - color: Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .decorationColor!)), + color: Theme.of(context).extension()!.textFieldButtonIconColor)), ), ), ), @@ -268,10 +265,7 @@ class ExchangeCardState extends State { placeholderTextStyle: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!), + color: Theme.of(context).extension()!.hintTextColor), validator: _isAmountEditable ? widget.currencyValueValidator : null), @@ -282,10 +276,7 @@ class ExchangeCardState extends State { height: 32, width: 32, decoration: BoxDecoration( - color: Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .color!, + color: Theme.of(context).extension()!.textFieldButtonColor, borderRadius: BorderRadius.all(Radius.circular(6))), child: InkWell( @@ -296,10 +287,7 @@ class ExchangeCardState extends State { style: TextStyle( fontSize: 12, fontWeight: FontWeight.bold, - color: Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .decorationColor!)), + color: Theme.of(context).extension()!.textFieldButtonIconColor)), ), ), ) @@ -310,10 +298,7 @@ class ExchangeCardState extends State { )), Divider( height: 1, - color: Theme.of(context) - .primaryTextTheme! - .headlineSmall! - .decorationColor!), + color: Theme.of(context).extension()!.textFieldHintColor), Padding( padding: EdgeInsets.only(top: 5), child: Container( @@ -329,10 +314,7 @@ class ExchangeCardState extends State { style: TextStyle( fontSize: 10, height: 1.2, - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!), + color: Theme.of(context).extension()!.hintTextColor), ) : Offstage(), _min != null ? SizedBox(width: 10) : Offstage(), @@ -344,10 +326,7 @@ class ExchangeCardState extends State { style: TextStyle( fontSize: 10, height: 1.2, - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!)) + color: Theme.of(context).extension()!.hintTextColor)) : Offstage(), ])), ), @@ -359,10 +338,7 @@ class ExchangeCardState extends State { style: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!), + color: Theme.of(context).extension()!.hintTextColor), )) : Offstage(), _isAddressEditable @@ -400,10 +376,7 @@ class ExchangeCardState extends State { hintStyle: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!), + color: Theme.of(context).extension()!.hintTextColor), buttonColor: widget.addressButtonsColor, validator: widget.addressTextFieldValidator, onPushPasteButton: widget.onPushPasteButton, @@ -472,10 +445,7 @@ class ExchangeCardState extends State { 6))), child: Image.asset( 'assets/images/open_book.png', - color: Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .decorationColor!, + color: Theme.of(context).extension()!.textFieldButtonIconColor, )), )), ), diff --git a/lib/src/screens/exchange/widgets/mobile_exchange_cards_section.dart b/lib/src/screens/exchange/widgets/mobile_exchange_cards_section.dart index 61da007f1..126bca835 100644 --- a/lib/src/screens/exchange/widgets/mobile_exchange_cards_section.dart +++ b/lib/src/screens/exchange/widgets/mobile_exchange_cards_section.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:flutter/material.dart'; class MobileExchangeCardsSection extends StatelessWidget { @@ -21,8 +22,8 @@ class MobileExchangeCardsSection extends StatelessWidget { ), gradient: LinearGradient( colors: [ - Theme.of(context).primaryTextTheme!.bodyMedium!.color!, - Theme.of(context).primaryTextTheme!.bodyMedium!.decorationColor!, + Theme.of(context).extension()!.firstGradientBottomPanelColor, + Theme.of(context).extension()!.secondGradientBottomPanelColor, ], stops: [0.35, 1.0], begin: Alignment.topLeft, @@ -37,11 +38,8 @@ class MobileExchangeCardsSection extends StatelessWidget { bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)), gradient: LinearGradient( colors: [ - Theme.of(context).primaryTextTheme!.titleSmall!.color!, - Theme.of(context) - .primaryTextTheme! - .titleSmall! - .decorationColor!, + Theme.of(context).extension()!.firstGradientTopPanelColor, + Theme.of(context).extension()!.secondGradientTopPanelColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight, diff --git a/lib/src/screens/exchange/widgets/present_provider_picker.dart b/lib/src/screens/exchange/widgets/present_provider_picker.dart index 20d3bf70c..75429aea9 100644 --- a/lib/src/screens/exchange/widgets/present_provider_picker.dart +++ b/lib/src/screens/exchange/widgets/present_provider_picker.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; +import 'package:cake_wallet/themes/extensions/qr_code_theme.dart'; import 'package:cake_wallet/src/widgets/check_box_picker.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:flutter/material.dart'; @@ -49,10 +50,7 @@ class PresentProviderPicker extends StatelessWidget { style: TextStyle( fontSize: 10.0, fontWeight: FontWeight.w500, - color: Theme.of(context) - .textTheme! - .headlineSmall! - .color!))) + color: Theme.of(context).extension()!.qrCodeColor))) ], ), SizedBox(width: 5), diff --git a/lib/src/screens/exchange_trade/exchange_confirm_page.dart b/lib/src/screens/exchange_trade/exchange_confirm_page.dart index e4422c36f..8070febdf 100644 --- a/lib/src/screens/exchange_trade/exchange_confirm_page.dart +++ b/lib/src/screens/exchange_trade/exchange_confirm_page.dart @@ -1,5 +1,7 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/exchange/exchange_provider_description.dart'; import 'package:cake_wallet/store/dashboard/trades_store.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:cake_wallet/utils/show_bar.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; @@ -9,6 +11,7 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/exchange/trade.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class ExchangeConfirmPage extends BasePage { ExchangeConfirmPage({required this.tradesStore}) : trade = tradesStore.trade!; @@ -36,10 +39,7 @@ class ExchangeConfirmPage extends BasePage { style: TextStyle( fontSize: 18.0, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!), + color: Theme.of(context).extension()!.titleColor), ), )), Container( @@ -48,14 +48,8 @@ class ExchangeConfirmPage extends BasePage { borderRadius: BorderRadius.all(Radius.circular(30)), border: Border.all( width: 1, - color: Theme.of(context) - .accentTextTheme! - .bodySmall! - .color!), - color: Theme.of(context) - .accentTextTheme! - .titleLarge! - .color!), + color: Theme.of(context).cardColor), + color: Theme.of(context).dialogTheme.backgroundColor), child: Column( children: [ Expanded( @@ -70,10 +64,7 @@ class ExchangeConfirmPage extends BasePage { style: TextStyle( fontSize: 12.0, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .labelSmall! - .color!), + color: Theme.of(context).extension()!.detailsTitlesColor), ), Text( trade.id, @@ -82,10 +73,7 @@ class ExchangeConfirmPage extends BasePage { style: TextStyle( fontSize: 20, fontWeight: FontWeight.w600, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!), + color: Theme.of(context).extension()!.titleColor), ), ], ), @@ -100,14 +88,8 @@ class ExchangeConfirmPage extends BasePage { context, S.of(context).copied_to_clipboard); }, text: S.of(context).copy_id, - color: Theme.of(context) - .accentTextTheme! - .bodySmall! - .backgroundColor!, - textColor: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!), + color: Theme.of(context).extension()!.buttonBackgroundColor, + textColor: Theme.of(context).extension()!.titleColor), ), ) ], @@ -136,10 +118,7 @@ class ExchangeConfirmPage extends BasePage { onPressed: () => Navigator.of(context) .pushReplacementNamed(Routes.exchangeTrade), text: S.of(context).saved_the_trade_id, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white) ], ), diff --git a/lib/src/screens/exchange_trade/exchange_trade_page.dart b/lib/src/screens/exchange_trade/exchange_trade_page.dart index c03c775a0..dbf6676a1 100644 --- a/lib/src/screens/exchange_trade/exchange_trade_page.dart +++ b/lib/src/screens/exchange_trade/exchange_trade_page.dart @@ -1,4 +1,6 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'dart:ui'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:cake_wallet/utils/request_review_handler.dart'; import 'package:mobx/mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; @@ -20,6 +22,7 @@ import 'package:cake_wallet/src/screens/exchange_trade/widgets/timer_widget.dart import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; void showInformation( ExchangeTradeViewModel exchangeTradeViewModel, BuildContext context) { @@ -51,7 +54,7 @@ class ExchangeTradePage extends BasePage { @override Widget trailing(BuildContext context) { final questionImage = Image.asset('assets/images/question_mark.png', - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!); + color: Theme.of(context).extension()!.titleColor); return SizedBox( height: 20.0, @@ -111,7 +114,7 @@ class ExchangeTradeState extends State { final copyImage = Image.asset('assets/images/copy_content.png', height: 16, width: 16, - color: Theme.of(context).primaryTextTheme!.labelSmall!.color!); + color: Theme.of(context).extension()!.detailsTitlesColor); _setEffects(); @@ -133,17 +136,11 @@ class ExchangeTradeState extends State { style: TextStyle( fontSize: 14.0, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .labelSmall! - .color!), + color: Theme.of(context).extension()!.detailsTitlesColor), ), if (trade.expiredAt != null) TimerWidget(trade.expiredAt!, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!) + color: Theme.of(context).extension()!.titleColor) ]) : Offstage(), Padding( @@ -160,10 +157,7 @@ class ExchangeTradeState extends State { decoration: BoxDecoration( border: Border.all( width: 3, - color: Theme.of(context) - .accentTextTheme! - .titleSmall! - .color! + color: Theme.of(context).extension()!.qrCodeColor ) ), child: QrImage(data: trade.inputAddress ?? fetchingLabel), @@ -179,10 +173,7 @@ class ExchangeTradeState extends State { itemCount: widget.exchangeTradeViewModel.items.length, separatorBuilder: (context, index) => Container( height: 1, - color: Theme.of(context) - .accentTextTheme! - .titleSmall! - .backgroundColor!, + color: Theme.of(context).extension()!.dividerCodeColor, ), itemBuilder: (context, index) { final item = widget.exchangeTradeViewModel.items[index]; @@ -228,10 +219,7 @@ class ExchangeTradeState extends State { onPressed: () => widget.exchangeTradeViewModel.confirmSending(), text: S.of(context).confirm, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white) : Offstage(); })), @@ -321,7 +309,7 @@ class ExchangeTradeState extends State { return Stack( children: [ Container( - color: Theme.of(popupContext).backgroundColor, + color: Theme.of(popupContext).colorScheme.background, child: Center( child: Image.asset( 'assets/images/birthday_cake.png'), @@ -341,10 +329,7 @@ class ExchangeTradeState extends State { style: TextStyle( fontSize: 22, fontWeight: FontWeight.bold, - color: Theme.of(popupContext) - .primaryTextTheme! - .titleLarge! - .color, + color: Theme.of(popupContext).extension()!.titleColor, decoration: TextDecoration.none, ), ), @@ -360,10 +345,7 @@ class ExchangeTradeState extends State { RequestReviewHandler.requestReview(); }, text: S.of(popupContext).got_it, - color: Theme.of(popupContext) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(popupContext).primaryColor, textColor: Colors.white)) ], ); @@ -372,7 +354,7 @@ class ExchangeTradeState extends State { return Stack( children: [ Container( - color: Theme.of(popupContext).backgroundColor, + color: Theme.of(popupContext).colorScheme.background, child: Center( child: Image.asset( 'assets/images/birthday_cake.png'), @@ -384,7 +366,8 @@ class ExchangeTradeState extends State { child: Container( decoration: BoxDecoration( color: Theme.of(popupContext) - .backgroundColor + .colorScheme + .background .withOpacity(0.25)), child: Center( child: Padding( @@ -395,10 +378,7 @@ class ExchangeTradeState extends State { style: TextStyle( fontSize: 22, fontWeight: FontWeight.bold, - color: Theme.of(popupContext) - .primaryTextTheme! - .titleLarge! - .color!, + color: Theme.of(popupContext).extension()!.titleColor, decoration: TextDecoration.none, ), ), diff --git a/lib/src/screens/exchange_trade/information_page.dart b/lib/src/screens/exchange_trade/information_page.dart index 260060485..eed124b97 100644 --- a/lib/src/screens/exchange_trade/information_page.dart +++ b/lib/src/screens/exchange_trade/information_page.dart @@ -1,9 +1,13 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'dart:ui'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/info_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/src/widgets/alert_background.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; class InformationPage extends StatelessWidget { InformationPage({required this.information}); @@ -21,7 +25,7 @@ class InformationPage extends StatelessWidget { ), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), - color: Theme.of(context).textTheme!.bodyLarge!.decorationColor! + color: Theme.of(context).extension()!.backgroundColor ), child: Column( mainAxisSize: MainAxisSize.min, @@ -36,7 +40,7 @@ class InformationPage extends StatelessWidget { fontWeight: FontWeight.normal, fontFamily: 'Lato', decoration: TextDecoration.none, - color: Theme.of(context).accentTextTheme!.bodySmall!.decorationColor! + color: Theme.of(context).extension()!.textColor ), ), ), @@ -45,8 +49,8 @@ class InformationPage extends StatelessWidget { child: PrimaryButton( onPressed: () => Navigator.of(context).pop(), text: S.of(context).got_it, - color: Theme.of(context).accentTextTheme!.bodySmall!.backgroundColor!, - textColor: Theme.of(context).primaryTextTheme!.titleLarge!.color! + color: Theme.of(context).extension()!.buttonBackgroundColor, + textColor: Theme.of(context).extension()!.titleColor ), ) ], diff --git a/lib/src/screens/faq/faq_item.dart b/lib/src/screens/faq/faq_item.dart index c41adf399..9ed346ef4 100644 --- a/lib/src/screens/faq/faq_item.dart +++ b/lib/src/screens/faq/faq_item.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/palette.dart'; @@ -26,12 +27,12 @@ class FAQItemState extends State { @override Widget build(BuildContext context) { final addIcon = Icon(Icons.add, - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!); + color: Theme.of(context).extension()!.titleColor); final removeIcon = Icon(Icons.remove, color: Palette.blueCraiola); final icon = isActive ? removeIcon : addIcon; final color = isActive ? Palette.blueCraiola - : Theme.of(context).primaryTextTheme!.titleLarge!.color!; + : Theme.of(context).extension()!.titleColor; return ListTileTheme( contentPadding: EdgeInsets.fromLTRB(0, 6, 24, 6), @@ -54,7 +55,7 @@ class FAQItemState extends State { fontSize: 14, fontWeight: FontWeight.normal, color: - Theme.of(context).primaryTextTheme!.titleLarge!.color!), + Theme.of(context).extension()!.titleColor), ), )) ]) diff --git a/lib/src/screens/ionia/auth/ionia_create_account_page.dart b/lib/src/screens/ionia/auth/ionia_create_account_page.dart index 3c8c71290..e6dc83c3c 100644 --- a/lib/src/screens/ionia/auth/ionia_create_account_page.dart +++ b/lib/src/screens/ionia/auth/ionia_create_account_page.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/core/email_validator.dart'; import 'package:cake_wallet/ionia/ionia_create_state.dart'; import 'package:cake_wallet/routes.dart'; @@ -40,10 +41,7 @@ class IoniaCreateAccountPage extends BasePage { return Text( S.current.sign_up, style: textMediumSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.titleColor, ), ); } @@ -84,10 +82,7 @@ class IoniaCreateAccountPage extends BasePage { onPressed: _createAccount, isLoading: _authViewModel.createUserState is IoniaCreateStateLoading, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), ), @@ -107,10 +102,7 @@ class IoniaCreateAccountPage extends BasePage { TextSpan( text: S.of(context).settings_terms_and_conditions, style: TextStyle( - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, fontWeight: FontWeight.w700, ), recognizer: TapGestureRecognizer() @@ -122,10 +114,7 @@ class IoniaCreateAccountPage extends BasePage { TextSpan( text: S.of(context).privacy_policy, style: TextStyle( - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, fontWeight: FontWeight.w700, ), recognizer: TapGestureRecognizer() diff --git a/lib/src/screens/ionia/auth/ionia_login_page.dart b/lib/src/screens/ionia/auth/ionia_login_page.dart index 912b9c3dc..1bdcfc3a4 100644 --- a/lib/src/screens/ionia/auth/ionia_login_page.dart +++ b/lib/src/screens/ionia/auth/ionia_login_page.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/core/email_validator.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/ionia/ionia_create_state.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; @@ -33,10 +34,7 @@ class IoniaLoginPage extends BasePage { return Text( S.current.login, style: textMediumSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.titleColor, ), ); } @@ -74,10 +72,7 @@ class IoniaLoginPage extends BasePage { text: S.of(context).login, onPressed: _login, isLoading: _authViewModel.signInState is IoniaCreateStateLoading, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), ), diff --git a/lib/src/screens/ionia/auth/ionia_verify_otp_page.dart b/lib/src/screens/ionia/auth/ionia_verify_otp_page.dart index 7382a6aee..e8327b71c 100644 --- a/lib/src/screens/ionia/auth/ionia_verify_otp_page.dart +++ b/lib/src/screens/ionia/auth/ionia_verify_otp_page.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; import 'package:cake_wallet/ionia/ionia_create_state.dart'; import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/routes.dart'; @@ -41,10 +43,7 @@ class IoniaVerifyIoniaOtp extends BasePage { return Text( S.current.verification, style: textMediumSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.titleColor, ), ); } @@ -65,10 +64,7 @@ class IoniaVerifyIoniaOtp extends BasePage { return KeyboardActions( config: KeyboardActionsConfig( keyboardActionsPlatform: KeyboardActionsPlatform.IOS, - keyboardBarColor: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .backgroundColor!, + keyboardBarColor: Theme.of(context).extension()!.keyboardBarColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -126,10 +122,7 @@ class IoniaVerifyIoniaOtp extends BasePage { onPressed: _verify, isDisabled: _authViewModel.otpState is IoniaOtpSendDisabled, isLoading: _authViewModel.otpState is IoniaOtpValidating, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), ), diff --git a/lib/src/screens/ionia/auth/ionia_welcome_page.dart b/lib/src/screens/ionia/auth/ionia_welcome_page.dart index 91d09c2db..e44e3a26d 100644 --- a/lib/src/screens/ionia/auth/ionia_welcome_page.dart +++ b/lib/src/screens/ionia/auth/ionia_welcome_page.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; @@ -14,10 +15,7 @@ class IoniaWelcomePage extends BasePage { return Text( S.current.welcome_to_cakepay, style: textMediumSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.titleColor, ), ); } @@ -38,7 +36,7 @@ class IoniaWelcomePage extends BasePage { fontSize: 18, fontWeight: FontWeight.w400, fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), ), SizedBox(height: 20), @@ -48,7 +46,7 @@ class IoniaWelcomePage extends BasePage { fontSize: 18, fontWeight: FontWeight.w400, fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), ), ], @@ -59,10 +57,7 @@ class IoniaWelcomePage extends BasePage { PrimaryButton( text: S.of(context).create_account, onPressed: () => Navigator.of(context).pushNamed(Routes.ioniaCreateAccountPage), - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), SizedBox( @@ -74,7 +69,7 @@ class IoniaWelcomePage extends BasePage { fontSize: 15, fontWeight: FontWeight.w500, fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), ), SizedBox(height: 8), diff --git a/lib/src/screens/ionia/cards/ionia_account_cards_page.dart b/lib/src/screens/ionia/cards/ionia_account_cards_page.dart index 1e88078ee..b96249b69 100644 --- a/lib/src/screens/ionia/cards/ionia_account_cards_page.dart +++ b/lib/src/screens/ionia/cards/ionia_account_cards_page.dart @@ -1,14 +1,19 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/ionia/ionia_create_state.dart'; import 'package:cake_wallet/ionia/ionia_gift_card.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/ionia/widgets/card_item.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/order_theme.dart'; import 'package:cake_wallet/typography.dart'; import 'package:cake_wallet/view_model/ionia/ionia_account_view_model.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class IoniaAccountCardsPage extends BasePage { IoniaAccountCardsPage(this.ioniaAccountViewModel); @@ -20,10 +25,7 @@ class IoniaAccountCardsPage extends BasePage { return Text( S.of(context).cards, style: textLargeSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.titleColor, ), ); } @@ -72,10 +74,7 @@ class _IoniaCardTabsState extends State<_IoniaCardTabs> with SingleTickerProvide width: 230, padding: EdgeInsets.all(5), decoration: BoxDecoration( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor! + color: Theme.of(context).extension()!.titleColor .withOpacity(0.1), borderRadius: BorderRadius.circular( 25.0, @@ -89,17 +88,11 @@ class _IoniaCardTabsState extends State<_IoniaCardTabs> with SingleTickerProvide borderRadius: BorderRadius.circular( 25.0, ), - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, ), - labelColor: Theme.of(context) - .primaryTextTheme! - .displayLarge! - .backgroundColor!, + labelColor: Theme.of(context).extension()!.iconColor, unselectedLabelColor: - Theme.of(context).primaryTextTheme!.titleLarge!.color!, + Theme.of(context).extension()!.titleColor, tabs: [ Tab( text: S.of(context).active, @@ -169,12 +162,9 @@ class _IoniaCardListView extends StatelessWidget { if(isLoading){ return Center( child: CircularProgressIndicator( - backgroundColor: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + backgroundColor: Theme.of(context).extension()!.textColor, valueColor: AlwaysStoppedAnimation( - Theme.of(context).primaryTextTheme!.bodyMedium!.color!), + Theme.of(context).extension()!.firstGradientBottomPanelColor), ), ); } @@ -184,7 +174,7 @@ class _IoniaCardListView extends StatelessWidget { emptyText, textAlign: TextAlign.center, style: textSmall( - color: Theme.of(context).primaryTextTheme!.labelSmall!.color!, + color: Theme.of(context).extension()!.detailsTitlesColor, ), ), ) @@ -197,18 +187,12 @@ class _IoniaCardListView extends StatelessWidget { child: CardItem( onTap: () => onTap?.call(merchant), title: merchant.legalName, - backgroundColor: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor! + backgroundColor: Theme.of(context).extension()!.titleColor .withOpacity(0.1), discount: 0, hideBorder: true, discountBackground: AssetImage('assets/images/red_badge_discount.png'), - titleColor: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + titleColor: Theme.of(context).extension()!.titleColor, subtitleColor: Theme.of(context).hintColor, subTitle: '', logoUrl: merchant.logoUrl, diff --git a/lib/src/screens/ionia/cards/ionia_account_page.dart b/lib/src/screens/ionia/cards/ionia_account_page.dart index f3ce3f560..8fddc507a 100644 --- a/lib/src/screens/ionia/cards/ionia_account_page.dart +++ b/lib/src/screens/ionia/cards/ionia_account_page.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/generated/i18n.dart'; @@ -8,6 +9,7 @@ import 'package:cake_wallet/typography.dart'; import 'package:cake_wallet/view_model/ionia/ionia_account_view_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class IoniaAccountPage extends BasePage { IoniaAccountPage(this.ioniaAccountViewModel); @@ -19,10 +21,7 @@ class IoniaAccountPage extends BasePage { return Text( S.current.account, style: textMediumSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.titleColor, ), ); } @@ -136,10 +135,7 @@ class IoniaAccountPage extends BasePage { bottomSection: Column( children: [ PrimaryButton( - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, text: S.of(context).logout, onPressed: () { @@ -170,8 +166,8 @@ class _GradiantContainer extends StatelessWidget { borderRadius: BorderRadius.circular(15), gradient: LinearGradient( colors: [ - Theme.of(context).primaryTextTheme!.titleMedium!.decorationColor!, - Theme.of(context).primaryTextTheme!.titleMedium!.color!, + Theme.of(context).extension()!.secondGradientColor, + Theme.of(context).extension()!.firstGradientColor, ], begin: Alignment.topRight, end: Alignment.bottomLeft, diff --git a/lib/src/screens/ionia/cards/ionia_activate_debit_card_page.dart b/lib/src/screens/ionia/cards/ionia_activate_debit_card_page.dart index ff1b918eb..f0e641c42 100644 --- a/lib/src/screens/ionia/cards/ionia_activate_debit_card_page.dart +++ b/lib/src/screens/ionia/cards/ionia_activate_debit_card_page.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/ionia/ionia_create_state.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; @@ -23,10 +24,7 @@ class IoniaActivateDebitCardPage extends BasePage { return Text( S.current.debit_card, style: textMediumSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.titleColor, ), ); } @@ -79,10 +77,7 @@ class IoniaActivateDebitCardPage extends BasePage { }, isLoading: _cardsListViewModel.createCardState is IoniaCreateCardLoading, text: S.of(context).agree_and_continue, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), ); diff --git a/lib/src/screens/ionia/cards/ionia_buy_card_detail_page.dart b/lib/src/screens/ionia/cards/ionia_buy_card_detail_page.dart index 5d91b3464..917c1d8fd 100644 --- a/lib/src/screens/ionia/cards/ionia_buy_card_detail_page.dart +++ b/lib/src/screens/ionia/cards/ionia_buy_card_detail_page.dart @@ -1,4 +1,6 @@ import 'package:cake_wallet/core/execution_state.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/ionia/ionia_merchant.dart'; import 'package:cake_wallet/ionia/ionia_tip.dart'; import 'package:cake_wallet/palette.dart'; @@ -9,6 +11,7 @@ import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/src/widgets/discount_badge.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:cake_wallet/typography.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/ionia/ionia_purchase_merch_view_model.dart'; @@ -18,6 +21,8 @@ import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/send/widgets/confirm_sending_alert.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class IoniaBuyGiftCardDetailPage extends BasePage { IoniaBuyGiftCardDetailPage(this.ioniaPurchaseViewModel); @@ -28,7 +33,7 @@ class IoniaBuyGiftCardDetailPage extends BasePage { Widget middle(BuildContext context) { return Text( ioniaPurchaseViewModel.ioniaMerchant.legalName, - style: textMediumSemiBold(color: Theme.of(context).accentTextTheme!.displayLarge!.backgroundColor!), + style: textMediumSemiBold(color: Theme.of(context).extension()!.titleColor), ); } @@ -96,8 +101,8 @@ class IoniaBuyGiftCardDetailPage extends BasePage { borderRadius: BorderRadius.circular(20), gradient: LinearGradient( colors: [ - Theme.of(context).primaryTextTheme!.titleMedium!.color!, - Theme.of(context).primaryTextTheme!.titleMedium!.decorationColor!, + Theme.of(context).extension()!.firstGradientColor, + Theme.of(context).extension()!.secondGradientColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight, @@ -163,7 +168,7 @@ class IoniaBuyGiftCardDetailPage extends BasePage { Text( S.of(context).tip, style: TextStyle( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, fontWeight: FontWeight.w700, fontSize: 14, ), @@ -202,7 +207,7 @@ class IoniaBuyGiftCardDetailPage extends BasePage { ioniaPurchaseViewModel.invoiceCommittingState is IsExecutingState, onPressed: () => purchaseCard(context), text: S.of(context).purchase_gift_card, - color: Theme.of(context).accentTextTheme!.bodyLarge!.color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ); }), @@ -212,7 +217,7 @@ class IoniaBuyGiftCardDetailPage extends BasePage { onTap: () => _showTermsAndCondition(context), child: Text(S.of(context).settings_terms_and_conditions, style: textMediumSemiBold( - color: Theme.of(context).primaryTextTheme.bodyMedium!.color!, + color: Theme.of(context).extension()!.firstGradientBottomPanelColor, ).copyWith(fontSize: 12)), ), SizedBox(height: 16) @@ -232,7 +237,7 @@ class IoniaBuyGiftCardDetailPage extends BasePage { child: Text( ioniaPurchaseViewModel.ioniaMerchant.termsAndConditions, style: textMedium( - color: Theme.of(context).textTheme!.displaySmall!.color!, + color: Theme.of(context).extension()!.tilesTextColor, ), ), ), @@ -270,13 +275,13 @@ class IoniaBuyGiftCardDetailPage extends BasePage { child: Text( instruction.header, style: textLargeSemiBold( - color: Theme.of(context).textTheme!.displaySmall!.color!, + color: Theme.of(context).extension()!.tilesTextColor, ), )), Text( instruction.body, style: textMedium( - color: Theme.of(context).textTheme!.displaySmall!.color!, + color: Theme.of(context).extension()!.tilesTextColor, ), ) ]; @@ -323,7 +328,7 @@ class IoniaBuyGiftCardDetailPage extends BasePage { alertLeftActionButtonTextColor: Colors.white, alertRightActionButtonTextColor: Colors.white, alertLeftActionButtonColor: Palette.brightOrange, - alertRightActionButtonColor: Theme.of(context).textTheme!.titleSmall!.color, + alertRightActionButtonColor: Theme.of(context).primaryColor, actionRightButton: () async { Navigator.of(context).pop(); await ioniaPurchaseViewModel.commitPaymentInvoice(); @@ -399,34 +404,34 @@ class TipButton extends StatelessWidget { Color captionTextColor(BuildContext context) { if (isDark(context)) { - return Theme.of(context).primaryTextTheme!.titleLarge!.color!; + return Theme.of(context).extension()!.titleColor; } return isSelected - ? Theme.of(context).accentTextTheme!.titleLarge!.color! - : Theme.of(context).primaryTextTheme!.titleLarge!.color!; + ? Theme.of(context).dialogTheme.backgroundColor! + : Theme.of(context).extension()!.titleColor; } Color subTitleTextColor(BuildContext context) { if (isDark(context)) { - return Theme.of(context).primaryTextTheme!.titleLarge!.color!; + return Theme.of(context).extension()!.titleColor; } return isSelected - ? Theme.of(context).accentTextTheme!.titleLarge!.color! - : Theme.of(context).primaryTextTheme!.labelSmall!.color!; + ? Theme.of(context).dialogTheme.backgroundColor! + : Theme.of(context).extension()!.detailsTitlesColor; } Color? backgroundColor(BuildContext context) { if (isDark(context)) { return isSelected ? null - : Theme.of(context).accentTextTheme!.displayLarge!.backgroundColor!.withOpacity(0.01); + : Theme.of(context).extension()!.titleColor.withOpacity(0.01); } return isSelected ? null - : Theme.of(context).accentTextTheme!.displayLarge!.backgroundColor!.withOpacity(0.1); + : Theme.of(context).extension()!.titleColor.withOpacity(0.1); } @override @@ -459,8 +464,8 @@ class TipButton extends StatelessWidget { gradient: isSelected ? LinearGradient( colors: [ - Theme.of(context).primaryTextTheme!.titleMedium!.color!, - Theme.of(context).primaryTextTheme!.titleMedium!.decorationColor!, + Theme.of(context).extension()!.firstGradientColor, + Theme.of(context).extension()!.secondGradientColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight, diff --git a/lib/src/screens/ionia/cards/ionia_buy_gift_card.dart b/lib/src/screens/ionia/cards/ionia_buy_gift_card.dart index e8dce712e..ba5b4fbbd 100644 --- a/lib/src/screens/ionia/cards/ionia_buy_gift_card.dart +++ b/lib/src/screens/ionia/cards/ionia_buy_gift_card.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/ionia/widgets/card_item.dart'; @@ -13,6 +15,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:keyboard_actions/keyboard_actions.dart'; import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class IoniaBuyGiftCardPage extends BasePage { IoniaBuyGiftCardPage( @@ -29,9 +32,6 @@ class IoniaBuyGiftCardPage extends BasePage { @override String get title => S.current.enter_amount; - @override - Color get titleColor => Colors.white; - @override bool get extendBodyBehindAppBar => true; @@ -50,10 +50,7 @@ class IoniaBuyGiftCardPage extends BasePage { disableScroll: true, config: KeyboardActionsConfig( keyboardActionsPlatform: KeyboardActionsPlatform.IOS, - keyboardBarColor: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .backgroundColor!, + keyboardBarColor: Theme.of(context).extension()!.keyboardBarColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -75,11 +72,8 @@ class IoniaBuyGiftCardPage extends BasePage { bottomRight: Radius.circular(24), ), gradient: LinearGradient(colors: [ - Theme.of(context).primaryTextTheme!.titleMedium!.color!, - Theme.of(context) - .primaryTextTheme! - .titleMedium! - .decorationColor!, + Theme.of(context).extension()!.firstGradientColor, + Theme.of(context).extension()!.secondGradientColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight), ), child: Column( @@ -101,10 +95,7 @@ class IoniaBuyGiftCardPage extends BasePage { ], hintText: '1000', placeholderTextStyle: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .headlineSmall! - .color!, + color: Theme.of(context).extension()!.textFieldBorderColor, fontWeight: FontWeight.w600, fontSize: 36, ), @@ -124,10 +115,7 @@ class IoniaBuyGiftCardPage extends BasePage { ), ), Divider( - color: Theme.of(context) - .primaryTextTheme! - .headlineSmall! - .color!, + color: Theme.of(context).extension()!.textFieldBorderColor, height: 1, ), SizedBox(height: 8), @@ -138,19 +126,13 @@ class IoniaBuyGiftCardPage extends BasePage { Text( S.of(context).min_amount(merchant.minimumCardPurchase.toStringAsFixed(2)), style: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .headlineSmall! - .color!, + color: Theme.of(context).extension()!.textFieldBorderColor, ), ), Text( S.of(context).max_amount(merchant.maximumCardPurchase.toStringAsFixed(2)), style: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .headlineSmall! - .color!, + color: Theme.of(context).extension()!.textFieldBorderColor, ), ), ], @@ -163,16 +145,10 @@ class IoniaBuyGiftCardPage extends BasePage { padding: const EdgeInsets.all(24.0), child: CardItem( title: merchant.legalName, - backgroundColor: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor! + backgroundColor: Theme.of(context).extension()!.titleColor .withOpacity(0.1), discount: merchant.discount, - titleColor: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + titleColor: Theme.of(context).extension()!.titleColor, subtitleColor: Theme.of(context).hintColor, subTitle: merchant.avaibilityStatus, logoUrl: merchant.logoUrl, @@ -195,10 +171,7 @@ class IoniaBuyGiftCardPage extends BasePage { ), text: S.of(context).continue_text, isDisabled: !ioniaBuyCardViewModel.isEnablePurchase, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), ); diff --git a/lib/src/screens/ionia/cards/ionia_custom_redeem_page.dart b/lib/src/screens/ionia/cards/ionia_custom_redeem_page.dart index 2a5f39845..7cc4d1f0c 100644 --- a/lib/src/screens/ionia/cards/ionia_custom_redeem_page.dart +++ b/lib/src/screens/ionia/cards/ionia_custom_redeem_page.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/core/execution_state.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/ionia/widgets/card_item.dart'; @@ -12,6 +14,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:keyboard_actions/keyboard_actions.dart'; import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class IoniaCustomRedeemPage extends BasePage { IoniaCustomRedeemPage( @@ -28,9 +31,6 @@ class IoniaCustomRedeemPage extends BasePage { @override String get title => S.current.custom_redeem_amount; - @override - Color get titleColor => Colors.white; - @override bool get extendBodyBehindAppBar => true; @@ -50,10 +50,7 @@ class IoniaCustomRedeemPage extends BasePage { disableScroll: true, config: KeyboardActionsConfig( keyboardActionsPlatform: KeyboardActionsPlatform.IOS, - keyboardBarColor: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .backgroundColor!, + keyboardBarColor: Theme.of(context).extension()!.keyboardBarColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -73,11 +70,8 @@ class IoniaCustomRedeemPage extends BasePage { borderRadius: BorderRadius.only( bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)), gradient: LinearGradient(colors: [ - Theme.of(context).primaryTextTheme!.titleMedium!.color!, - Theme.of(context) - .primaryTextTheme! - .titleMedium! - .decorationColor!, + Theme.of(context).extension()!.firstGradientColor, + Theme.of(context).extension()!.secondGradientColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight), ), child: Column( @@ -92,17 +86,11 @@ class IoniaCustomRedeemPage extends BasePage { inputFormatters: [FilteringTextInputFormatter.deny(RegExp('[\-|\ ]'))], hintText: '1000', placeholderTextStyle: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .headlineSmall! - .color!, + color: Theme.of(context).extension()!.textFieldBorderColor, fontWeight: FontWeight.w500, fontSize: 36, ), - borderColor: Theme.of(context) - .primaryTextTheme! - .headlineSmall! - .color!, + borderColor: Theme.of(context).extension()!.textFieldBorderColor, textColor: Colors.white, textStyle: TextStyle( color: Colors.white, @@ -133,10 +121,7 @@ class IoniaCustomRedeemPage extends BasePage { child: Text( '\$${giftCard.remainingAmount} - \$${ioniaCustomRedeemViewModel.amount} = \$${ioniaCustomRedeemViewModel.formattedRemaining} ${S.of(context).remaining}', style: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .headlineSmall! - .color!, + color: Theme.of(context).extension()!.textFieldBorderColor, ), ), ) @@ -150,18 +135,12 @@ class IoniaCustomRedeemPage extends BasePage { padding: const EdgeInsets.all(24.0), child: CardItem( title: giftCard.legalName, - backgroundColor: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor! + backgroundColor: Theme.of(context).extension()!.titleColor .withOpacity(0.1), discount: giftCard.remainingAmount, isAmount: true, discountBackground: AssetImage('assets/images/red_badge_discount.png'), - titleColor: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + titleColor: Theme.of(context).extension()!.titleColor, subtitleColor: Theme.of(context).hintColor, subTitle: S.of(context).online, logoUrl: giftCard.logoUrl, @@ -178,10 +157,7 @@ class IoniaCustomRedeemPage extends BasePage { isLoading: ioniaCustomRedeemViewModel.redeemState is IsExecutingState, isDisabled: ioniaCustomRedeemViewModel.disableRedeem, text: S.of(context).add_custom_redemption, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, onPressed: () => ioniaCustomRedeemViewModel.addCustomRedeem().then((value) { Navigator.of(context).pop(ioniaCustomRedeemViewModel.remaining.toString()); diff --git a/lib/src/screens/ionia/cards/ionia_custom_tip_page.dart b/lib/src/screens/ionia/cards/ionia_custom_tip_page.dart index f31f0ef30..eced01e96 100644 --- a/lib/src/screens/ionia/cards/ionia_custom_tip_page.dart +++ b/lib/src/screens/ionia/cards/ionia_custom_tip_page.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/ionia/ionia_merchant.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/ionia/widgets/card_item.dart'; @@ -12,6 +14,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:keyboard_actions/keyboard_actions.dart'; import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class IoniaCustomTipPage extends BasePage { IoniaCustomTipPage( @@ -29,9 +32,6 @@ class IoniaCustomTipPage extends BasePage { @override String get title => S.current.enter_amount; - @override - Color get titleColor => Colors.white; - @override bool get extendBodyBehindAppBar => true; @@ -51,10 +51,7 @@ class IoniaCustomTipPage extends BasePage { disableScroll: true, config: KeyboardActionsConfig( keyboardActionsPlatform: KeyboardActionsPlatform.IOS, - keyboardBarColor: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .backgroundColor!, + keyboardBarColor: Theme.of(context).extension()!.keyboardBarColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -73,11 +70,8 @@ class IoniaCustomTipPage extends BasePage { decoration: BoxDecoration( borderRadius: BorderRadius.only(bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)), gradient: LinearGradient(colors: [ - Theme.of(context).primaryTextTheme!.titleMedium!.color!, - Theme.of(context) - .primaryTextTheme! - .titleMedium! - .decorationColor!, + Theme.of(context).extension()!.firstGradientColor, + Theme.of(context).extension()!.secondGradientColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight), ), child: Column( @@ -92,17 +86,11 @@ class IoniaCustomTipPage extends BasePage { inputFormatters: [FilteringTextInputFormatter.deny(RegExp('[\-|\ ]'))], hintText: '1000', placeholderTextStyle: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .headlineSmall! - .color!, + color: Theme.of(context).extension()!.textFieldBorderColor, fontWeight: FontWeight.w500, fontSize: 36, ), - borderColor: Theme.of(context) - .primaryTextTheme! - .headlineSmall! - .color!, + borderColor: Theme.of(context).extension()!.textFieldBorderColor, textColor: Colors.white, textStyle: TextStyle( color: Colors.white, @@ -137,10 +125,7 @@ class IoniaCustomTipPage extends BasePage { text: TextSpan( text: '\$${_amountController.text}', style: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .headlineSmall! - .color!, + color: Theme.of(context).extension()!.textFieldBorderColor, ), children: [ TextSpan(text: ' ${S.of(context).is_percentage} '), @@ -158,16 +143,10 @@ class IoniaCustomTipPage extends BasePage { padding: const EdgeInsets.all(24.0), child: CardItem( title: merchant.legalName, - backgroundColor: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor! + backgroundColor: Theme.of(context).extension()!.titleColor .withOpacity(0.1), discount: 0.0, - titleColor: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + titleColor: Theme.of(context).extension()!.titleColor, subtitleColor: Theme.of(context).hintColor, subTitle: merchant.isOnline ? S.of(context).online : S.of(context).offline, logoUrl: merchant.logoUrl, @@ -184,10 +163,7 @@ class IoniaCustomTipPage extends BasePage { Navigator.of(context).pop(customTipViewModel.customTip); }, text: S.of(context).add_tip, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), ), diff --git a/lib/src/screens/ionia/cards/ionia_debit_card_page.dart b/lib/src/screens/ionia/cards/ionia_debit_card_page.dart index 3cdb7c5df..7e6a43253 100644 --- a/lib/src/screens/ionia/cards/ionia_debit_card_page.dart +++ b/lib/src/screens/ionia/cards/ionia_debit_card_page.dart @@ -1,4 +1,6 @@ import 'package:cake_wallet/ionia/ionia_create_state.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/ionia/ionia_virtual_card.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; @@ -6,12 +8,14 @@ import 'package:cake_wallet/src/screens/ionia/widgets/text_icon_button.dart'; import 'package:cake_wallet/src/widgets/alert_background.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; +import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart'; import 'package:cake_wallet/typography.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/ionia/ionia_gift_cards_list_view_model.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class IoniaDebitCardPage extends BasePage { final IoniaGiftCardsListViewModel _cardsListViewModel; @@ -23,10 +27,7 @@ class IoniaDebitCardPage extends BasePage { return Text( S.current.debit_card, style: textMediumSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.titleColor, ), ); } @@ -55,10 +56,7 @@ class IoniaDebitCardPage extends BasePage { child: Text( S.of(context).billing_address_info, style: textSmall( - color: Theme.of(context) - .textTheme! - .headlineMedium! - .color!), + color: Theme.of(context).extension()!.iconsColor), textAlign: TextAlign.center, ), ), @@ -67,16 +65,13 @@ class IoniaDebitCardPage extends BasePage { text: S.of(context).order_physical_card, onPressed: () {}, color: Color(0xffE9F2FC), - textColor: Theme.of(context).textTheme!.displaySmall!.color!, + textColor: Theme.of(context).extension()!.tilesTextColor, ), SizedBox(height: 8), PrimaryButton( text: S.of(context).add_value, onPressed: () {}, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), SizedBox(height: 16) @@ -124,15 +119,12 @@ class IoniaDebitCardPage extends BasePage { text: S.of(context).get_a, style: textMedium( color: - Theme.of(context).textTheme!.displaySmall!.color!), + Theme.of(context).extension()!.tilesTextColor), children: [ TextSpan( text: S.of(context).digital_and_physical_card, style: textMediumBold( - color: Theme.of(context) - .textTheme! - .displaySmall! - .color!), + color: Theme.of(context).extension()!.tilesTextColor), ), TextSpan( text: S.of(context).get_card_note, @@ -150,10 +142,7 @@ class IoniaDebitCardPage extends BasePage { bottomSection: PrimaryButton( text: S.of(context).activate, onPressed: () => _showHowToUseCard(context, activate: true), - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), ); @@ -185,7 +174,7 @@ class IoniaDebitCardPage extends BasePage { S.of(context).how_to_use_card, style: textLargeSemiBold( color: - Theme.of(context).textTheme!.bodyMedium!.color!, + Theme.of(context).extension()!.thumbColor, ), ), SizedBox(height: 24), @@ -194,10 +183,7 @@ class IoniaDebitCardPage extends BasePage { child: Text( S.of(context).signup_for_card_accept_terms, style: textSmallSemiBold( - color: Theme.of(context) - .textTheme! - .displaySmall! - .color!, + color: Theme.of(context).extension()!.tilesTextColor, ), ), ), @@ -219,7 +205,7 @@ class IoniaDebitCardPage extends BasePage { text: S.of(context).got_it, color: Color.fromRGBO(233, 242, 252, 1), textColor: - Theme.of(context).textTheme!.displaySmall!.color!, + Theme.of(context).extension()!.tilesTextColor, ), SizedBox(height: 21), ], @@ -283,8 +269,8 @@ class _IoniaDebitCardState extends State<_IoniaDebitCard> { borderRadius: BorderRadius.circular(24), gradient: LinearGradient( colors: [ - Theme.of(context).primaryTextTheme!.titleMedium!.color!, - Theme.of(context).primaryTextTheme!.titleMedium!.decorationColor!, + Theme.of(context).extension()!.firstGradientColor, + Theme.of(context).extension()!.secondGradientColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight, @@ -393,13 +379,13 @@ class _TitleSubtitleTile extends StatelessWidget { Text( title, style: textSmallSemiBold( - color: Theme.of(context).textTheme!.displaySmall!.color!), + color: Theme.of(context).extension()!.tilesTextColor), ), SizedBox(height: 4), Text( subtitle, style: textSmall( - color: Theme.of(context).textTheme!.displaySmall!.color!), + color: Theme.of(context).extension()!.tilesTextColor), ), ], ); diff --git a/lib/src/screens/ionia/cards/ionia_gift_card_detail_page.dart b/lib/src/screens/ionia/cards/ionia_gift_card_detail_page.dart index 5107dedee..dba78f557 100644 --- a/lib/src/screens/ionia/cards/ionia_gift_card_detail_page.dart +++ b/lib/src/screens/ionia/cards/ionia_gift_card_detail_page.dart @@ -1,4 +1,6 @@ import 'package:cake_wallet/core/execution_state.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/ionia/ionia_gift_card.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; @@ -33,7 +35,7 @@ class IoniaGiftCardDetailPage extends BasePage { final _backButton = Icon( Icons.arrow_back_ios, - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, size: 16, ); return Padding( @@ -60,10 +62,7 @@ class IoniaGiftCardDetailPage extends BasePage { return Text( viewModel.giftCard.legalName, style: textMediumSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!), + color: Theme.of(context).extension()!.titleColor), ); } @@ -145,8 +144,8 @@ class IoniaGiftCardDetailPage extends BasePage { viewModel.refeshCard(); }, text: S.of(context).more_options, - color: Theme.of(context).accentTextTheme!.bodySmall!.color!, - textColor: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).cardColor, + textColor: Theme.of(context).extension()!.titleColor, ), SizedBox(height: 12), LoadingPrimaryButton( @@ -158,7 +157,7 @@ class IoniaGiftCardDetailPage extends BasePage { }, ), text: S.of(context).mark_as_redeemed, - color: Theme.of(context).accentTextTheme!.bodyLarge!.color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), ], @@ -201,13 +200,13 @@ class IoniaGiftCardDetailPage extends BasePage { child: Text( instruction.header, style: textLargeSemiBold( - color: Theme.of(context).textTheme!.displaySmall!.color!, + color: Theme.of(context).extension()!.tilesTextColor, ), )), Text( instruction.body, style: textMedium( - color: Theme.of(context).textTheme!.displaySmall!.color!, + color: Theme.of(context).extension()!.tilesTextColor, ), ) ]; diff --git a/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart b/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart index b4ab07ca7..c29f571b4 100644 --- a/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart +++ b/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart @@ -2,10 +2,13 @@ import 'package:cake_wallet/ionia/ionia_create_state.dart'; import 'package:cake_wallet/ionia/ionia_merchant.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; +import 'package:cake_wallet/src/widgets/gradient_background.dart'; import 'package:cake_wallet/src/screens/ionia/widgets/card_item.dart'; import 'package:cake_wallet/src/screens/ionia/widgets/card_menu.dart'; import 'package:cake_wallet/src/screens/ionia/widgets/ionia_filter_modal.dart'; import 'package:cake_wallet/src/widgets/cake_scrollbar.dart'; +import 'package:cake_wallet/themes/extensions/exchange_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/debounce.dart'; import 'package:cake_wallet/typography.dart'; @@ -15,6 +18,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:flutter_mobx/flutter_mobx.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/filter_theme.dart'; class IoniaManageCardsPage extends BasePage { IoniaManageCardsPage(this._cardsListViewModel): searchFocusNode = FocusNode() { @@ -36,29 +42,12 @@ class IoniaManageCardsPage extends BasePage { final _searchController = TextEditingController(); @override - Color get backgroundLightColor => currentTheme.type == ThemeType.bright ? Colors.transparent : Colors.white; + bool get gradientBackground => true; @override - Color get backgroundDarkColor => Colors.transparent; - - @override - Color get titleColor => currentTheme.type == ThemeType.bright ? Colors.white : Colors.black; - - @override - Widget Function(BuildContext, Widget) get rootWrapper => (BuildContext context, Widget scaffold) => Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - Theme.of(context).colorScheme.secondary, - Theme.of(context).scaffoldBackgroundColor, - Theme.of(context).primaryColor, - ], - begin: Alignment.topRight, - end: Alignment.bottomLeft, - ), - ), - child: scaffold, - ); + Widget Function(BuildContext, Widget) get rootWrapper => + (BuildContext context, Widget scaffold) => + GradientBackground(scaffold: scaffold); @override bool get resizeToAvoidBottomInset => false; @@ -71,10 +60,7 @@ class IoniaManageCardsPage extends BasePage { return Text( S.of(context).gift_cards, style: textMediumSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), ); } @@ -100,7 +86,7 @@ class IoniaManageCardsPage extends BasePage { width: 32, padding: EdgeInsets.all(8), decoration: BoxDecoration( - color: Theme.of(context).textTheme!.titleLarge!.backgroundColor!, + color: Theme.of(context).extension()!.syncedBackgroundColor, border: Border.all( color: Colors.white.withOpacity(0.2), ), @@ -108,7 +94,7 @@ class IoniaManageCardsPage extends BasePage { ), child: Image.asset( 'assets/images/filter.png', - color: Theme.of(context).textTheme!.bodySmall!.decorationColor!, + color: Theme.of(context).extension()!.iconColor, ), )), ); @@ -208,9 +194,9 @@ class _IoniaManageCardsPageBodyState extends State { }, title: merchant.legalName, subTitle: merchant.avaibilityStatus, - backgroundColor: Theme.of(context).textTheme!.titleLarge!.backgroundColor!, - titleColor: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!, - subtitleColor: Theme.of(context).accentTextTheme!.displaySmall!.backgroundColor!, + backgroundColor: Theme.of(context).extension()!.syncedBackgroundColor, + titleColor: Theme.of(context).extension()!.textColor, + subtitleColor: Theme.of(context).extension()!.labelTextColor, discount: merchant.discount, ); }, @@ -221,8 +207,8 @@ class _IoniaManageCardsPageBodyState extends State { thumbHeight: thumbHeight, rightOffset: 1, width: 3, - backgroundColor: Theme.of(context).textTheme!.bodySmall!.decorationColor!.withOpacity(0.05), - thumbColor: Theme.of(context).textTheme!.bodySmall!.decorationColor!.withOpacity(0.5), + backgroundColor: Theme.of(context).extension()!.iconColor.withOpacity(0.05), + thumbColor: Theme.of(context).extension()!.iconColor.withOpacity(0.5), fromTop: widget.cardsListViewModel.scrollOffsetFromTop, ) : Offstage() @@ -230,8 +216,8 @@ class _IoniaManageCardsPageBodyState extends State { } return Center( child: CircularProgressIndicator( - backgroundColor: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!, - valueColor: AlwaysStoppedAnimation(Theme.of(context).primaryTextTheme!.bodyMedium!.color!), + backgroundColor: Theme.of(context).extension()!.textColor, + valueColor: AlwaysStoppedAnimation(Theme.of(context).extension()!.firstGradientBottomPanelColor), ), ); } @@ -254,14 +240,14 @@ class _SearchWidget extends StatelessWidget { padding: EdgeInsets.all(8), child: Image.asset( 'assets/images/mini_search_icon.png', - color: Theme.of(context).textTheme!.bodySmall!.decorationColor!, + color: Theme.of(context).extension()!.iconColor, ), ), ); return TextField( focusNode: focusNode, - style: TextStyle(color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!), + style: TextStyle(color: Theme.of(context).extension()!.textColor), controller: controller, decoration: InputDecoration( filled: true, @@ -269,10 +255,10 @@ class _SearchWidget extends StatelessWidget { top: 10, left: 10, ), - fillColor: Theme.of(context).textTheme!.titleLarge!.backgroundColor!, + fillColor: Theme.of(context).extension()!.syncedBackgroundColor, hintText: S.of(context).search, hintStyle: TextStyle( - color: Theme.of(context).accentTextTheme!.displaySmall!.backgroundColor!, + color: Theme.of(context).extension()!.labelTextColor, ), alignLabelWithHint: true, floatingLabelBehavior: FloatingLabelBehavior.never, @@ -318,8 +304,7 @@ class _TrailingIcon extends StatelessWidget { onPressed: onPressed, icon: Image.asset( asset, - color: - Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), ), ), diff --git a/lib/src/screens/ionia/cards/ionia_more_options_page.dart b/lib/src/screens/ionia/cards/ionia_more_options_page.dart index c2b76c1b8..eb6ed8860 100644 --- a/lib/src/screens/ionia/cards/ionia_more_options_page.dart +++ b/lib/src/screens/ionia/cards/ionia_more_options_page.dart @@ -1,7 +1,9 @@ import 'package:cake_wallet/ionia/ionia_gift_card.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; import 'package:cake_wallet/typography.dart'; import 'package:flutter/material.dart'; @@ -15,10 +17,7 @@ class IoniaMoreOptionsPage extends BasePage { return Text( S.current.more_options, style: textMediumSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.titleColor, ), ); } @@ -37,7 +36,7 @@ class IoniaMoreOptionsPage extends BasePage { child: Text( S.of(context).choose_from_available_options, style: textMedium( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), ), ), @@ -80,8 +79,8 @@ class _GradiantContainer extends StatelessWidget { borderRadius: BorderRadius.circular(15), gradient: LinearGradient( colors: [ - Theme.of(context).scaffoldBackgroundColor, - Theme.of(context).colorScheme.secondary, + Theme.of(context).extension()!.secondGradientBackgroundColor, + Theme.of(context).extension()!.firstGradientBackgroundColor, ], begin: Alignment.topRight, end: Alignment.bottomLeft, diff --git a/lib/src/screens/ionia/cards/ionia_payment_status_page.dart b/lib/src/screens/ionia/cards/ionia_payment_status_page.dart index 50af2f2f6..dce976444 100644 --- a/lib/src/screens/ionia/cards/ionia_payment_status_page.dart +++ b/lib/src/screens/ionia/cards/ionia_payment_status_page.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/ionia/ionia_gift_card.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; @@ -11,6 +12,7 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:mobx/mobx.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class IoniaPaymentStatusPage extends BasePage { IoniaPaymentStatusPage(this.viewModel); @@ -23,10 +25,7 @@ class IoniaPaymentStatusPage extends BasePage { S.of(context).generating_gift_card, textAlign: TextAlign.center, style: textMediumSemiBold( - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .backgroundColor!)); + color: Theme.of(context).extension()!.titleColor)); } @override @@ -93,7 +92,7 @@ class _IoniaPaymentStatusPageBodyBodyState extends State<_IoniaPaymentStatusPage Text( S.of(context).awaiting_payment_confirmation, style: textLargeSemiBold( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!)) + color: Theme.of(context).extension()!.titleColor)) ]), SizedBox(height: 40), Row(children: [ @@ -132,7 +131,7 @@ class _IoniaPaymentStatusPageBodyBodyState extends State<_IoniaPaymentStatusPage Text( S.of(context).gift_card_is_generated, style: textLargeSemiBold( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!)) + color: Theme.of(context).extension()!.titleColor)) ])); } @@ -150,7 +149,7 @@ class _IoniaPaymentStatusPageBodyBodyState extends State<_IoniaPaymentStatusPage Text( S.of(context).generating_gift_card, style: textLargeSemiBold( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!))]); + color: Theme.of(context).extension()!.titleColor))]); }), ], ), @@ -163,7 +162,7 @@ class _IoniaPaymentStatusPageBodyBodyState extends State<_IoniaPaymentStatusPage widget.viewModel.payingByBitcoin ? S.of(context).bitcoin_payments_require_1_confirmation : S.of(context).proceed_after_one_minute, style: textMedium( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ).copyWith(fontWeight: FontWeight.w500), textAlign: TextAlign.center, )), @@ -175,15 +174,15 @@ class _IoniaPaymentStatusPageBodyBodyState extends State<_IoniaPaymentStatusPage Routes.ioniaGiftCardDetailPage, arguments: [widget.viewModel.giftCard]), text: S.of(context).open_gift_card, - color: Theme.of(context).accentTextTheme!.bodyLarge!.color!, + color: Theme.of(context).primaryColor, textColor: Colors.white); } return PrimaryButton( onPressed: () => Navigator.of(context).pushNamed(Routes.support), text: S.of(context).contact_support, - color: Theme.of(context).accentTextTheme!.bodySmall!.color!, - textColor: Theme.of(context).primaryTextTheme!.titleLarge!.color!); + color: Theme.of(context).cardColor, + textColor: Theme.of(context).extension()!.titleColor); }) ]) ), @@ -199,14 +198,14 @@ class _IoniaPaymentStatusPageBodyBodyState extends State<_IoniaPaymentStatusPage Text( title, style: textXSmall( - color: Theme.of(context).primaryTextTheme!.labelSmall!.color!, + color: Theme.of(context).extension()!.detailsTitlesColor, ), ), SizedBox(height: 8), Text( subtitle, style: textMedium( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), ), ], diff --git a/lib/src/screens/ionia/widgets/ionia_alert_model.dart b/lib/src/screens/ionia/widgets/ionia_alert_model.dart index 536bb19d4..57a93a127 100644 --- a/lib/src/screens/ionia/widgets/ionia_alert_model.dart +++ b/lib/src/screens/ionia/widgets/ionia_alert_model.dart @@ -1,5 +1,7 @@ import 'package:cake_wallet/src/widgets/alert_background.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; +import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart'; import 'package:cake_wallet/typography.dart'; import 'package:flutter/material.dart'; @@ -41,7 +43,7 @@ class IoniaAlertModal extends StatelessWidget { Text( title, style: textLargeSemiBold( - color: Theme.of(context).textTheme!.bodyMedium!.color!, + color: Theme.of(context).extension()!.thumbColor, ), ), Container( @@ -56,12 +58,9 @@ class IoniaAlertModal extends StatelessWidget { PrimaryButton( onPressed: () => Navigator.pop(context), text: actionTitle, - color: Theme.of(context) - .accentTextTheme! - .bodySmall! - .color!, + color: Theme.of(context).cardColor, textColor: - Theme.of(context).primaryTextTheme!.titleLarge!.color!, + Theme.of(context).extension()!.titleColor, ), SizedBox(height: 21), ], diff --git a/lib/src/screens/ionia/widgets/ionia_filter_modal.dart b/lib/src/screens/ionia/widgets/ionia_filter_modal.dart index 4c40270b1..8a6820fcd 100644 --- a/lib/src/screens/ionia/widgets/ionia_filter_modal.dart +++ b/lib/src/screens/ionia/widgets/ionia_filter_modal.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/src/screens/ionia/widgets/rounded_checkbox.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/src/widgets/alert_background.dart'; import 'package:cake_wallet/typography.dart'; import 'package:cake_wallet/generated/i18n.dart'; @@ -6,6 +7,7 @@ import 'package:cake_wallet/view_model/ionia/ionia_gift_cards_list_view_model.da import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; class IoniaFilterModal extends StatelessWidget { IoniaFilterModal({required this.ioniaGiftCardsListViewModel}){ @@ -20,7 +22,7 @@ class IoniaFilterModal extends StatelessWidget { padding: EdgeInsets.all(10), child: Image.asset( 'assets/images/mini_search_icon.png', - color: Theme.of(context).textTheme!.titleSmall!.color!, + color: Theme.of(context).primaryColor, ), ); return Scaffold( @@ -46,14 +48,14 @@ class IoniaFilterModal extends StatelessWidget { child: TextField( onChanged: ioniaGiftCardsListViewModel.onSearchFilter, style: textMedium( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), decoration: InputDecoration( filled: true, prefixIcon: searchIcon, hintText: S.of(context).search_category, contentPadding: EdgeInsets.only(bottom: 5), - fillColor: Theme.of(context).primaryTextTheme!.bodySmall!.decorationColor!.withOpacity(0.5), + fillColor: Theme.of(context).extension()!.dividerColor.withOpacity(0.5), border: OutlineInputBorder( borderSide: BorderSide.none, borderRadius: BorderRadius.circular(8), @@ -84,12 +86,12 @@ class IoniaFilterModal extends StatelessWidget { children: [ Image.asset( category.iconPath, - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), SizedBox(width: 10), Text(category.title, style: textSmall( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ).copyWith(fontWeight: FontWeight.w500)), ], ), diff --git a/lib/src/screens/ionia/widgets/ionia_tile.dart b/lib/src/screens/ionia/widgets/ionia_tile.dart index b7a672b35..932674451 100644 --- a/lib/src/screens/ionia/widgets/ionia_tile.dart +++ b/lib/src/screens/ionia/widgets/ionia_tile.dart @@ -1,5 +1,7 @@ import 'package:cake_wallet/typography.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class IoniaTile extends StatelessWidget { const IoniaTile({ @@ -26,14 +28,14 @@ class IoniaTile extends StatelessWidget { Text( title, style: textXSmall( - color: Theme.of(context).primaryTextTheme!.labelSmall!.color!, + color: Theme.of(context).extension()!.detailsTitlesColor, ), ), SizedBox(height: 8), Text( subTitle, style: textMediumBold( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), ), ], diff --git a/lib/src/screens/ionia/widgets/rounded_checkbox.dart b/lib/src/screens/ionia/widgets/rounded_checkbox.dart index 51a09e5d9..509708dc2 100644 --- a/lib/src/screens/ionia/widgets/rounded_checkbox.dart +++ b/lib/src/screens/ionia/widgets/rounded_checkbox.dart @@ -15,7 +15,7 @@ class RoundedCheckbox extends StatelessWidget { width: 20.0, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(50.0)), - color: Theme.of(context).accentTextTheme!.bodyLarge!.color!, + color: Theme.of(context).primaryColor, ), child: Icon( Icons.check, diff --git a/lib/src/screens/ionia/widgets/text_icon_button.dart b/lib/src/screens/ionia/widgets/text_icon_button.dart index 600e62aa2..937df3a36 100644 --- a/lib/src/screens/ionia/widgets/text_icon_button.dart +++ b/lib/src/screens/ionia/widgets/text_icon_button.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/typography.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; class TextIconButton extends StatelessWidget { @@ -22,12 +23,12 @@ class TextIconButton extends StatelessWidget { Text( label, style: textMediumSemiBold( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), ), Icon( Icons.chevron_right_rounded, - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), ], ), diff --git a/lib/src/screens/monero_accounts/monero_account_edit_or_create_page.dart b/lib/src/screens/monero_accounts/monero_account_edit_or_create_page.dart index 1b5f6be6b..779628be8 100644 --- a/lib/src/screens/monero_accounts/monero_account_edit_or_create_page.dart +++ b/lib/src/screens/monero_accounts/monero_account_edit_or_create_page.dart @@ -56,7 +56,7 @@ class MoneroAccountEditOrCreatePage extends BasePage { text: moneroAccountCreationViewModel.isEdit ? S.of(context).rename : S.of(context).add, - color: Theme.of(context).accentTextTheme!.bodyLarge!.color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, isLoading: moneroAccountCreationViewModel.state is IsExecutingState, diff --git a/lib/src/screens/monero_accounts/monero_account_list_page.dart b/lib/src/screens/monero_accounts/monero_account_list_page.dart index be3cfc083..6b3d3e08b 100644 --- a/lib/src/screens/monero_accounts/monero_account_list_page.dart +++ b/lib/src/screens/monero_accounts/monero_account_list_page.dart @@ -31,7 +31,7 @@ class MoneroAccountListPage extends StatelessWidget { child: ListView.separated( padding: EdgeInsets.zero, controller: controller, - separatorBuilder: (context, index) => const SectionDivider(), + separatorBuilder: (context, index) => const VerticalSectionDivider(), itemCount: accounts.length, itemBuilder: (context, index) { final account = accounts[index]; @@ -59,7 +59,7 @@ class MoneroAccountListPage extends StatelessWidget { await Navigator.of(context).pushNamed(Routes.accountCreation), child: Container( height: buttonHeight, - color: Theme.of(context).cardColor, + color: Theme.of(context).primaryColor, padding: EdgeInsets.symmetric(horizontal: 24), child: Center( child: Row( diff --git a/lib/src/screens/monero_accounts/widgets/account_tile.dart b/lib/src/screens/monero_accounts/widgets/account_tile.dart index d034ca11a..fa8221513 100644 --- a/lib/src/screens/monero_accounts/widgets/account_tile.dart +++ b/lib/src/screens/monero_accounts/widgets/account_tile.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/themes/extensions/account_list_theme.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:cake_wallet/generated/i18n.dart'; @@ -21,11 +23,11 @@ class AccountTile extends StatelessWidget { @override Widget build(BuildContext context) { final color = isCurrent - ? Theme.of(context).textTheme.titleSmall!.decorationColor! - : Theme.of(context).textTheme.displayLarge!.decorationColor!; + ? Theme.of(context).extension()!.currentAccountBackgroundColor + : Theme.of(context).extension()!.tilesBackgroundColor; final textColor = isCurrent - ? Theme.of(context).textTheme.titleSmall!.color! - : Theme.of(context).textTheme.displayLarge!.color!; + ? Theme.of(context).extension()!.currentAccountTextColor + : Theme.of(context).extension()!.tilesTextColor; final Widget cell = GestureDetector( onTap: onTap, @@ -61,7 +63,9 @@ class AccountTile extends StatelessWidget { fontSize: 15, fontWeight: FontWeight.w600, fontFamily: 'Lato', - color: Theme.of(context).textTheme.headlineMedium!.color!, + color: isCurrent + ? Theme.of(context).extension()!.currentAccountAmountColor + : Theme.of(context).extension()!.tilesAmountColor, decoration: TextDecoration.none, ), ), @@ -72,24 +76,20 @@ class AccountTile extends StatelessWidget { ); // return cell; - return Slidable( - key: Key(accountName), - child: cell, - endActionPane: _actionPane(context) - ); + return Slidable(key: Key(accountName), child: cell, endActionPane: _actionPane(context)); } ActionPane _actionPane(BuildContext context) => ActionPane( - motion: const ScrollMotion(), - extentRatio: 0.3, - children: [ - SlidableAction( - onPressed: (_) => onEdit.call(), - backgroundColor: Colors.blue, - foregroundColor: Colors.white, - icon: Icons.edit, - label: S.of(context).edit, - ), - ], - ); + motion: const ScrollMotion(), + extentRatio: 0.3, + children: [ + SlidableAction( + onPressed: (_) => onEdit.call(), + backgroundColor: Colors.blue, + foregroundColor: Colors.white, + icon: Icons.edit, + label: S.of(context).edit, + ), + ], + ); } diff --git a/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart b/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart index c568761b9..386f3012b 100644 --- a/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart +++ b/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart @@ -3,6 +3,7 @@ import 'package:cake_wallet/entities/fiat_api_mode.dart'; import 'package:cake_wallet/src/screens/nodes/widgets/node_form.dart'; import 'package:cake_wallet/src/screens/settings/widgets/settings_choices_cell.dart'; import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart'; +import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart'; import 'package:cake_wallet/view_model/advanced_privacy_settings_view_model.dart'; import 'package:cake_wallet/view_model/settings/choices_list_item.dart'; @@ -111,10 +112,7 @@ class _AdvancedPrivacySettingsBodyState extends State()!.hintTextColor, ), ), ), diff --git a/lib/src/screens/new_wallet/new_wallet_page.dart b/lib/src/screens/new_wallet/new_wallet_page.dart index 39cd006f5..b9dcc5ae3 100644 --- a/lib/src/screens/new_wallet/new_wallet_page.dart +++ b/lib/src/screens/new_wallet/new_wallet_page.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/entities/generate_name.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/main.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/themes/theme_base.dart'; @@ -17,6 +18,8 @@ import 'package:cake_wallet/src/screens/seed_language/widgets/seed_language_pick import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/core/execution_state.dart'; import 'package:cake_wallet/view_model/wallet_new_vm.dart'; +import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class NewWalletPage extends BasePage { NewWalletPage(this._walletNewVM); @@ -117,32 +120,20 @@ class _WalletNameFormState extends State { 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).wallet_name, 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), ), suffixIcon: Semantics( @@ -169,10 +160,7 @@ class _WalletNameFormState extends State { height: 34, child: Image.asset( 'assets/images/refresh_icon.png', - color: Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .decorationColor!, + color: Theme.of(context).extension()!.textFieldButtonIconColor, ), ), ), @@ -193,10 +181,7 @@ class _WalletNameFormState extends State { style: TextStyle( fontSize: 16.0, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!), + color: Theme.of(context).extension()!.titleColor), ), ), Padding( diff --git a/lib/src/screens/new_wallet/new_wallet_type_page.dart b/lib/src/screens/new_wallet/new_wallet_type_page.dart index d28ff9d77..6f3bb078b 100644 --- a/lib/src/screens/new_wallet/new_wallet_type_page.dart +++ b/lib/src/screens/new_wallet/new_wallet_type_page.dart @@ -4,6 +4,7 @@ import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/src/widgets/search_bar_widget.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cake_wallet/wallet_types.g.dart'; @@ -80,7 +81,7 @@ class WalletTypeFormState extends State { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!), + color: Theme.of(context).extension()!.titleColor), ), ), Padding( @@ -112,7 +113,7 @@ class WalletTypeFormState extends State { bottomSection: PrimaryButton( onPressed: () => onTypeSelected(), text: S.of(context).seed_language_next, - color: Theme.of(context).accentTextTheme!.bodyLarge!.color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, isDisabled: selected == null, ), diff --git a/lib/src/screens/new_wallet/widgets/select_button.dart b/lib/src/screens/new_wallet/widgets/select_button.dart index 5d3892ede..e220b281e 100644 --- a/lib/src/screens/new_wallet/widgets/select_button.dart +++ b/lib/src/screens/new_wallet/widgets/select_button.dart @@ -1,4 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; +import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; class SelectButton extends StatelessWidget { SelectButton({ @@ -21,25 +24,13 @@ class SelectButton extends StatelessWidget { Widget build(BuildContext context) { final color = isSelected ? Colors.green - : Theme.of(context) - .accentTextTheme! - .bodySmall! - .color!; + : Theme.of(context).cardColor; final textColor = isSelected - ? Theme.of(context) - .accentTextTheme! - .headlineSmall! - .decorationColor! - : Theme.of(context).primaryTextTheme!.titleLarge!.color!; + ? Theme.of(context).extension()!.restoreWalletButtonTextColor + : Theme.of(context).extension()!.buttonTextColor; final arrowColor = isSelected - ? Theme.of(context) - .accentTextTheme! - .headlineSmall! - .decorationColor! - : Theme.of(context) - .accentTextTheme! - .titleMedium! - .color!; + ? Theme.of(context).extension()!.restoreWalletButtonTextColor + : Theme.of(context).extension()!.titlesColor; final selectArrowImage = Image.asset('assets/images/select_arrow.png', color: arrowColor); @@ -86,4 +77,4 @@ class SelectButton extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/src/screens/nodes/node_create_or_edit_page.dart b/lib/src/screens/nodes/node_create_or_edit_page.dart index c1b07d8c5..3525160e8 100644 --- a/lib/src/screens/nodes/node_create_or_edit_page.dart +++ b/lib/src/screens/nodes/node_create_or_edit_page.dart @@ -182,10 +182,7 @@ class NodeCreateOrEditPage extends BasePage { Navigator.of(context).pop(); }, text: S.of(context).save, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, isDisabled: (!nodeCreateOrEditViewModel.isReady)|| (nodeCreateOrEditViewModel diff --git a/lib/src/screens/nodes/widgets/node_list_row.dart b/lib/src/screens/nodes/widgets/node_list_row.dart index 89ec3bcc7..1739848d7 100644 --- a/lib/src/screens/nodes/widgets/node_list_row.dart +++ b/lib/src/screens/nodes/widgets/node_list_row.dart @@ -1,8 +1,10 @@ import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/nodes/widgets/node_indicator.dart'; import 'package:cake_wallet/src/widgets/standard_list.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; import 'package:cw_core/node.dart'; import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; class NodeListRow extends StandardListRow { NodeListRow( @@ -38,12 +40,13 @@ class NodeListRow extends StandardListRow { decoration: BoxDecoration( shape: BoxShape.circle, color: Theme.of(context) - .textTheme - .headlineMedium! - .decorationColor!), + .extension()! + .iconsBackgroundColor), child: Icon(Icons.edit, size: 14, - color: Theme.of(context).textTheme.headlineMedium!.color!))); + color: Theme.of(context) + .extension()! + .iconsColor))); } } @@ -56,7 +59,7 @@ class NodeHeaderListRow extends StandardListRow { return SizedBox( width: 20, child: Icon(Icons.add, - color: Theme.of(context).accentTextTheme!.titleMedium!.color,size: 24.0), + color: Theme.of(context).extension()!.titlesColor,size: 24.0), ); } } diff --git a/lib/src/screens/order_details/order_details_page.dart b/lib/src/screens/order_details/order_details_page.dart index 0784c7008..10254eaef 100644 --- a/lib/src/screens/order_details/order_details_page.dart +++ b/lib/src/screens/order_details/order_details_page.dart @@ -48,10 +48,9 @@ class OrderDetailsPageBodyState extends State { Widget build(BuildContext context) { return Observer(builder: (_) { return SectionStandardList( - context: context, sectionCount: 1, itemCounter: (int _) => orderDetailsViewModel.items.length, - itemBuilder: (_, __, index) { + itemBuilder: (__, index) { final item = orderDetailsViewModel.items[index]; if (item is TrackTradeListItem) { diff --git a/lib/src/screens/pin_code/pin_code_widget.dart b/lib/src/screens/pin_code/pin_code_widget.dart index e4df2d2fa..9b22fa822 100644 --- a/lib/src/screens/pin_code/pin_code_widget.dart +++ b/lib/src/screens/pin_code/pin_code_widget.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/themes/extensions/pin_code_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cake_wallet/utils/show_bar.dart'; import 'package:another_flushbar/flushbar.dart'; @@ -110,11 +112,11 @@ class PinCodeState extends State { Widget body(BuildContext context) { final deleteIconImage = Image.asset( 'assets/images/delete_icon.png', - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ); final faceImage = Image.asset( 'assets/images/face.png', - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ); return RawKeyboardListener( @@ -143,7 +145,7 @@ class PinCodeState extends State { fontSize: 20, fontWeight: FontWeight.w500, color: - Theme.of(context).primaryTextTheme!.titleLarge!.color!)), + Theme.of(context).extension()!.titleColor)), Spacer(flex: 3), Container( width: 180, @@ -159,14 +161,8 @@ class PinCodeState extends State { decoration: BoxDecoration( shape: BoxShape.circle, color: isFilled - ? Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color! - : Theme.of(context) - .accentTextTheme! - .bodyMedium! - .color! + ? Theme.of(context).extension()!.titleColor + : Theme.of(context).extension()!.indicatorsColor .withOpacity(0.25), )); }), @@ -185,10 +181,7 @@ class PinCodeState extends State { style: TextStyle( fontSize: 14.0, fontWeight: FontWeight.normal, - color: Theme.of(context) - .accentTextTheme! - .bodyMedium! - .decorationColor!), + color: Theme.of(context).extension()!.switchColor), ), ) ], @@ -256,10 +249,7 @@ class PinCodeState extends State { style: TextStyle( fontSize: 30.0, fontWeight: FontWeight.w600, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!)), + color: Theme.of(context).extension()!.titleColor)), ), ); }), diff --git a/lib/src/screens/receive/anonpay_invoice_page.dart b/lib/src/screens/receive/anonpay_invoice_page.dart index 88547e483..606383faa 100644 --- a/lib/src/screens/receive/anonpay_invoice_page.dart +++ b/lib/src/screens/receive/anonpay_invoice_page.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; import 'package:cake_wallet/anonpay/anonpay_donation_link_info.dart'; import 'package:cake_wallet/core/execution_state.dart'; import 'package:cake_wallet/di.dart'; @@ -40,8 +42,9 @@ class AnonPayInvoicePage extends BasePage { final _formKey = GlobalKey(); bool effectsInstalled = false; + @override - Color get titleColor => Colors.white; + bool get gradientAll => true; @override bool get resizeToAvoidBottomInset => false; @@ -56,8 +59,9 @@ class AnonPayInvoicePage extends BasePage { void onClose(BuildContext context) => Navigator.popUntil(context, (route) => route.isFirst); @override - Widget middle(BuildContext context) => - PresentReceiveOptionPicker(receiveOptionViewModel: receiveOptionViewModel); + Widget middle(BuildContext context) => PresentReceiveOptionPicker( + receiveOptionViewModel: receiveOptionViewModel, + color: titleColor(context)); @override Widget trailing(BuildContext context) => TrailButton( @@ -82,10 +86,7 @@ class AnonPayInvoicePage extends BasePage { disableScroll: true, config: KeyboardActionsConfig( keyboardActionsPlatform: KeyboardActionsPlatform.IOS, - keyboardBarColor: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .backgroundColor!, + keyboardBarColor: Theme.of(context).extension()!.keyboardBarColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -103,8 +104,8 @@ class AnonPayInvoicePage extends BasePage { bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)), gradient: LinearGradient( colors: [ - Theme.of(context).primaryTextTheme!.titleSmall!.color!, - Theme.of(context).primaryTextTheme!.titleSmall!.decorationColor!, + Theme.of(context).extension()!.firstGradientTopPanelColor, + Theme.of(context).extension()!.secondGradientTopPanelColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight, @@ -142,10 +143,7 @@ class AnonPayInvoicePage extends BasePage { : S.of(context).anonpay_description("a donation link", "donate"), textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .displayLarge! - .decorationColor!, + color: Theme.of(context).extension()!.receiveAmountColor, fontWeight: FontWeight.w500, fontSize: 12), ), @@ -173,10 +171,7 @@ class AnonPayInvoicePage extends BasePage { anonInvoicePageViewModel.generateDonationLink(); } }, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, isLoading: anonInvoicePageViewModel.state is IsExecutingState, ), diff --git a/lib/src/screens/receive/anonpay_receive_page.dart b/lib/src/screens/receive/anonpay_receive_page.dart index 4deae7972..1dae8e452 100644 --- a/lib/src/screens/receive/anonpay_receive_page.dart +++ b/lib/src/screens/receive/anonpay_receive_page.dart @@ -5,13 +5,15 @@ import 'package:cake_wallet/entities/receive_page_option.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; +import 'package:cake_wallet/src/widgets/gradient_background.dart'; import 'package:cake_wallet/src/screens/receive/widgets/anonpay_status_section.dart'; import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart'; import 'package:cake_wallet/src/screens/receive/widgets/copy_link_item.dart'; -import 'package:cake_wallet/themes/theme_base.dart'; +import 'package:cake_wallet/themes/extensions/qr_code_theme.dart'; import 'package:device_display_brightness/device_display_brightness.dart'; import 'package:flutter/material.dart'; import 'package:qr_flutter/qr_flutter.dart' as qr; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; class AnonPayReceivePage extends BasePage { final AnonpayInfoBase invoiceInfo; @@ -22,11 +24,7 @@ class AnonPayReceivePage extends BasePage { String get title => S.current.receive; @override - Color get backgroundLightColor => - currentTheme.type == ThemeType.bright ? Colors.transparent : Colors.white; - - @override - Color get backgroundDarkColor => Colors.transparent; + bool get gradientBackground => true; @override bool get resizeToAvoidBottomInset => false; @@ -44,10 +42,7 @@ class AnonPayReceivePage extends BasePage { fontSize: 18.0, fontWeight: FontWeight.bold, fontFamily: 'Lato', - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!), + color: titleColor(context)), ), Text( invoiceInfo is AnonpayInvoiceInfo @@ -56,7 +51,7 @@ class AnonPayReceivePage extends BasePage { style: TextStyle( fontSize: 10.0, fontWeight: FontWeight.w500, - color: Theme.of(context).textTheme!.headlineSmall!.color!), + color: Theme.of(context).extension()!.qrCodeColor), ) ], ); @@ -78,10 +73,7 @@ class AnonPayReceivePage extends BasePage { ), icon: Icon( Icons.edit, - color: Theme.of(context) - .accentTextTheme! - .bodySmall! - .color!, + color: pageIconColor(context), size: 22.0, ), ), @@ -90,14 +82,8 @@ class AnonPayReceivePage extends BasePage { @override Widget Function(BuildContext, Widget) get rootWrapper => - (BuildContext context, Widget scaffold) => Container( - decoration: BoxDecoration( - gradient: LinearGradient(colors: [ - Theme.of(context).colorScheme.secondary, - Theme.of(context).scaffoldBackgroundColor, - Theme.of(context).primaryColor, - ], begin: Alignment.topRight, end: Alignment.bottomLeft)), - child: scaffold); + (BuildContext context, Widget scaffold) => + GradientBackground(scaffold: scaffold); @override Widget body(BuildContext context) { @@ -139,10 +125,7 @@ class AnonPayReceivePage extends BasePage { decoration: BoxDecoration( border: Border.all( width: 3, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), ), child: QrImage( diff --git a/lib/src/screens/receive/fullscreen_qr_page.dart b/lib/src/screens/receive/fullscreen_qr_page.dart index b7949013e..d11722ccf 100644 --- a/lib/src/screens/receive/fullscreen_qr_page.dart +++ b/lib/src/screens/receive/fullscreen_qr_page.dart @@ -1,8 +1,9 @@ import 'package:cake_wallet/entities/qr_view_data.dart'; +import 'package:cake_wallet/src/widgets/gradient_background.dart'; import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart'; -import 'package:cake_wallet/themes/theme_base.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; class FullscreenQRPage extends BasePage { FullscreenQRPage({required this.qrViewData}); @@ -10,10 +11,7 @@ class FullscreenQRPage extends BasePage { final QrViewData qrViewData; @override - Color get backgroundLightColor => currentTheme.type == ThemeType.bright ? Colors.transparent : Colors.white; - - @override - Color get backgroundDarkColor => Colors.transparent; + bool get gradientBackground => true; @override bool get resizeToAvoidBottomInset => false; @@ -22,10 +20,7 @@ class FullscreenQRPage extends BasePage { Widget leading(BuildContext context) { final _backButton = Icon( Icons.arrow_back_ios, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.textColor, size: 16, ); @@ -47,19 +42,9 @@ class FullscreenQRPage extends BasePage { } @override - Widget Function(BuildContext, Widget) get rootWrapper => (BuildContext context, Widget scaffold) => Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - Theme.of(context).colorScheme.secondary, - Theme.of(context).scaffoldBackgroundColor, - Theme.of(context).primaryColor, - ], - begin: Alignment.topRight, - end: Alignment.bottomLeft, - ), - ), - child: scaffold); + Widget Function(BuildContext, Widget) get rootWrapper => + (BuildContext context, Widget scaffold) => + GradientBackground(scaffold: scaffold); @override Widget body(BuildContext context) { @@ -75,10 +60,7 @@ class FullscreenQRPage extends BasePage { decoration: BoxDecoration( border: Border.all( width: 3, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!)), + color: Theme.of(context).extension()!.textColor)), child: Container( decoration: BoxDecoration( border: Border.all(width: 3, color: Colors.white)), diff --git a/lib/src/screens/receive/receive_page.dart b/lib/src/screens/receive/receive_page.dart index 5c498b442..fa150f979 100644 --- a/lib/src/screens/receive/receive_page.dart +++ b/lib/src/screens/receive/receive_page.dart @@ -1,3 +1,6 @@ +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/src/widgets/gradient_background.dart'; import 'package:cake_wallet/src/widgets/keyboard_done_button.dart'; import 'package:cake_wallet/src/widgets/section_divider.dart'; import 'package:cake_wallet/themes/theme_base.dart'; @@ -19,6 +22,7 @@ import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_i import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart'; import 'package:cake_wallet/src/screens/receive/widgets/qr_widget.dart'; import 'package:keyboard_actions/keyboard_actions.dart'; +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; class ReceivePage extends BasePage { ReceivePage({required this.addressListViewModel}) @@ -41,21 +45,13 @@ class ReceivePage extends BasePage { String get title => S.current.receive; @override - Color get backgroundLightColor => - currentTheme.type == ThemeType.bright ? Colors.transparent : Colors.white; - - @override - Color get backgroundDarkColor => Colors.transparent; + bool get gradientBackground => true; @override bool get resizeToAvoidBottomInset => false; final FocusNode _cryptoAmountFocus; - @override - Color? get titleColor => - currentTheme.type == ThemeType.bright ? Colors.white : null; - @override Widget middle(BuildContext context) { return Text( @@ -64,23 +60,14 @@ class ReceivePage extends BasePage { fontSize: 18.0, fontWeight: FontWeight.bold, fontFamily: 'Lato', - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!), + color: pageIconColor(context)), ); } @override Widget Function(BuildContext, Widget) get rootWrapper => - (BuildContext context, Widget scaffold) => Container( - decoration: BoxDecoration( - gradient: LinearGradient(colors: [ - Theme.of(context).colorScheme.secondary, - Theme.of(context).scaffoldBackgroundColor, - Theme.of(context).primaryColor, - ], begin: Alignment.topRight, end: Alignment.bottomLeft)), - child: scaffold); + (BuildContext context, Widget scaffold) => + GradientBackground(scaffold: scaffold); @override Widget trailing(BuildContext context) { @@ -103,10 +90,7 @@ class ReceivePage extends BasePage { icon: Icon( Icons.share, size: 20, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: pageIconColor(context), ), ), )); @@ -119,10 +103,7 @@ class ReceivePage extends BasePage { ? KeyboardActions( config: KeyboardActionsConfig( keyboardActionsPlatform: KeyboardActionsPlatform.IOS, - keyboardBarColor: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .backgroundColor!, + keyboardBarColor: Theme.of(context).extension()!.keyboardBarColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -146,7 +127,7 @@ class ReceivePage extends BasePage { Observer( builder: (_) => ListView.separated( padding: EdgeInsets.all(0), - separatorBuilder: (context, _) => const SectionDivider(), + separatorBuilder: (context, _) => const HorizontalSectionDivider(), shrinkWrap: true, physics: NeverScrollableScrollPhysics(), itemCount: addressListViewModel.items.length, @@ -163,10 +144,7 @@ class ReceivePage extends BasePage { icon: Icon( Icons.arrow_forward_ios, size: 14, - color: Theme.of(context) - .textTheme! - .headlineMedium! - .color!, + color: Theme.of(context).extension()!.iconsColor, )); } @@ -178,10 +156,7 @@ class ReceivePage extends BasePage { icon: Icon( Icons.add, size: 20, - color: Theme.of(context) - .textTheme! - .headlineMedium! - .color!, + color: Theme.of(context).extension()!.iconsColor, )); } @@ -190,23 +165,11 @@ class ReceivePage extends BasePage { final isCurrent = item.address == addressListViewModel.address.address; final backgroundColor = isCurrent - ? Theme.of(context) - .textTheme! - .displayMedium! - .decorationColor! - : Theme.of(context) - .textTheme! - .displaySmall! - .decorationColor!; + ? Theme.of(context).extension()!.currentTileBackgroundColor + : Theme.of(context).extension()!.tilesBackgroundColor; final textColor = isCurrent - ? Theme.of(context) - .textTheme! - .displayMedium! - .color! - : Theme.of(context) - .textTheme! - .displaySmall! - .color!; + ? Theme.of(context).extension()!.currentTileTextColor + : Theme.of(context).extension()!.tilesTextColor; return AddressCell.fromItem(item, isCurrent: isCurrent, @@ -252,10 +215,7 @@ class ReceivePage extends BasePage { textAlign: TextAlign.center, style: TextStyle( fontSize: 15, - color: Theme.of(context) - .accentTextTheme! - .displaySmall! - .backgroundColor!)), + color: Theme.of(context).extension()!.labelTextColor)), ], ), ); diff --git a/lib/src/screens/receive/widgets/anonpay_currency_input_field.dart b/lib/src/screens/receive/widgets/anonpay_currency_input_field.dart index 5bca308c9..be39ac3bb 100644 --- a/lib/src/screens/receive/widgets/anonpay_currency_input_field.dart +++ b/lib/src/screens/receive/widgets/anonpay_currency_input_field.dart @@ -1,8 +1,10 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:cw_core/currency.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class AnonpayCurrencyInputField extends StatelessWidget { const AnonpayCurrencyInputField( @@ -33,7 +35,7 @@ class AnonpayCurrencyInputField extends StatelessWidget { border: Border( bottom: BorderSide( color: - Theme.of(context).primaryTextTheme!.bodyLarge!.color!, + Theme.of(context).extension()!.textFieldBorderBottomPanelColor, width: 1)), ), child: Padding( @@ -65,10 +67,7 @@ class AnonpayCurrencyInputField extends StatelessWidget { child: Container( height: 32, decoration: BoxDecoration( - color: Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .color!, + color: Theme.of(context).extension()!.textFieldButtonColor, borderRadius: BorderRadius.all(Radius.circular(6))), child: Center( child: Padding( @@ -78,10 +77,7 @@ class AnonpayCurrencyInputField extends StatelessWidget { style: TextStyle( fontSize: 12, fontWeight: FontWeight.bold, - color: Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .decorationColor!, + color: Theme.of(context).extension()!.textFieldButtonIconColor, ), ), ), @@ -119,10 +115,7 @@ class AnonpayCurrencyInputField extends StatelessWidget { placeholderTextStyle: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!, + color: Theme.of(context).extension()!.hintTextColor, ), validator: null, ), @@ -143,20 +136,14 @@ class AnonpayCurrencyInputField extends StatelessWidget { style: TextStyle( fontSize: 10, height: 1.2, - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!), + color: Theme.of(context).extension()!.hintTextColor), ), SizedBox(width: 10), Text(S.of(context).max_value(maxAmount, selectedCurrency.toString()), style: TextStyle( fontSize: 10, height: 1.2, - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!)), + color: Theme.of(context).extension()!.hintTextColor)), ], ), ) diff --git a/lib/src/screens/receive/widgets/anonpay_input_form.dart b/lib/src/screens/receive/widgets/anonpay_input_form.dart index b041aeee9..6dc30d177 100644 --- a/lib/src/screens/receive/widgets/anonpay_input_form.dart +++ b/lib/src/screens/receive/widgets/anonpay_input_form.dart @@ -3,6 +3,7 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart'; import 'package:cake_wallet/src/screens/receive/widgets/anonpay_currency_input_field.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:cake_wallet/typography.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/anon_invoice_page_view_model.dart'; @@ -69,17 +70,14 @@ class AnonInvoiceForm extends StatelessWidget { BaseTextFormField( controller: nameController, focusNode: _nameFocusNode, - borderColor: Theme.of(context).primaryTextTheme!.bodyLarge!.color!, + borderColor: Theme.of(context).extension()!.textFieldBorderTopPanelColor, suffixIcon: SizedBox(width: 36), hintText: S.of(context).optional_name, textInputAction: TextInputAction.next, placeholderTextStyle: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!, + color: Theme.of(context).extension()!.hintTextColor, ), textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white), validator: null, @@ -91,16 +89,13 @@ class AnonInvoiceForm extends StatelessWidget { controller: descriptionController, focusNode: _descriptionFocusNode, textInputAction: TextInputAction.next, - borderColor: Theme.of(context).primaryTextTheme!.bodyLarge!.color!, + borderColor: Theme.of(context).extension()!.textFieldBorderTopPanelColor, suffixIcon: SizedBox(width: 36), hintText: S.of(context).optional_description, placeholderTextStyle: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!, + color: Theme.of(context).extension()!.hintTextColor, ), textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white), validator: null, @@ -110,17 +105,14 @@ class AnonInvoiceForm extends StatelessWidget { controller: emailController, textInputAction: TextInputAction.next, focusNode: _emailFocusNode, - borderColor: Theme.of(context).primaryTextTheme!.bodyLarge!.color!, + borderColor: Theme.of(context).extension()!.textFieldBorderTopPanelColor, suffixIcon: SizedBox(width: 36), keyboardType: TextInputType.emailAddress, hintText: S.of(context).optional_email_hint, placeholderTextStyle: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!, + color: Theme.of(context).extension()!.hintTextColor, ), textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white), validator: EmailValidator(), diff --git a/lib/src/screens/receive/widgets/anonpay_status_section.dart b/lib/src/screens/receive/widgets/anonpay_status_section.dart index 21817d686..f92186aa4 100644 --- a/lib/src/screens/receive/widgets/anonpay_status_section.dart +++ b/lib/src/screens/receive/widgets/anonpay_status_section.dart @@ -1,6 +1,9 @@ import 'package:cake_wallet/anonpay/anonpay_invoice_info.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator_icon.dart'; +import 'package:cake_wallet/themes/extensions/address_theme.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:cake_wallet/typography.dart'; import 'package:flutter/material.dart'; @@ -31,19 +34,13 @@ class AnonInvoiceStatusSection extends StatelessWidget { style: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .displayLarge! - .decorationColor!, + color: Theme.of(context).extension()!.receiveAmountColor, ), ), Container( padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), decoration: BoxDecoration( - color: Theme.of(context) - .accentTextTheme! - .displaySmall! - .color!, + color: Theme.of(context).extension()!.actionButtonColor, borderRadius: BorderRadius.circular(10), ), child: Row( @@ -58,10 +55,7 @@ class AnonInvoiceStatusSection extends StatelessWidget { Text( invoiceInfo.status ?? '', style: textSmallSemiBold( - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color, + color: Theme.of(context).extension()!.titleColor, ), ) ], @@ -78,16 +72,13 @@ class AnonInvoiceStatusSection extends StatelessWidget { style: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .displayLarge! - .decorationColor!, + color: Theme.of(context).extension()!.receiveAmountColor, ), ), Text( invoiceInfo.invoiceId ?? '', style: textSmallSemiBold( - color: Theme.of(context).primaryTextTheme!.titleLarge!.color, + color: Theme.of(context).extension()!.titleColor, ), ), ], diff --git a/lib/src/screens/receive/widgets/copy_link_item.dart b/lib/src/screens/receive/widgets/copy_link_item.dart index cecf33e6c..7c1ffa874 100644 --- a/lib/src/screens/receive/widgets/copy_link_item.dart +++ b/lib/src/screens/receive/widgets/copy_link_item.dart @@ -5,6 +5,7 @@ import 'package:cake_wallet/utils/show_bar.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:share_plus/share_plus.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; class CopyLinkItem extends StatelessWidget { const CopyLinkItem({super.key, required this.url, required this.title}); @@ -14,10 +15,7 @@ class CopyLinkItem extends StatelessWidget { @override Widget build(BuildContext context) { final copyImage = Image.asset('assets/images/copy_address.png', - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!); + color: Theme.of(context).extension()!.textColor); return Row( mainAxisAlignment: MainAxisAlignment.center, @@ -25,10 +23,7 @@ class CopyLinkItem extends StatelessWidget { Text( title, style: textMedium( - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), ), SizedBox(width: 50), @@ -51,10 +46,7 @@ class CopyLinkItem extends StatelessWidget { onPressed: () => Share.share(url), icon: Icon( Icons.share, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), ) ], diff --git a/lib/src/screens/receive/widgets/currency_input_field.dart b/lib/src/screens/receive/widgets/currency_input_field.dart index 85e2cdbe2..20e7bd660 100644 --- a/lib/src/screens/receive/widgets/currency_input_field.dart +++ b/lib/src/screens/receive/widgets/currency_input_field.dart @@ -3,6 +3,9 @@ import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cw_core/currency.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/picker_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class CurrencyInputField extends StatelessWidget { const CurrencyInputField({ @@ -24,7 +27,7 @@ class CurrencyInputField extends StatelessWidget { Widget build(BuildContext context) { final arrowBottomPurple = Image.asset( 'assets/images/arrow_bottom_purple_icon.png', - color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!, + color: Theme.of(context).extension()!.textColor, height: 8, ); // This magic number for wider screen sets the text input focus at center of the inputfield @@ -46,13 +49,13 @@ class CurrencyInputField extends StatelessWidget { placeholderTextStyle: isLight ? null : TextStyle( - color: Theme.of(context).primaryTextTheme!.headlineSmall!.color!, + color: Theme.of(context).extension()!.textFieldBorderColor, fontWeight: FontWeight.w600, ), - borderColor: Theme.of(context).accentTextTheme!.titleLarge!.backgroundColor!, - textColor: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!, + borderColor: Theme.of(context).extension()!.dividerColor, + textColor: Theme.of(context).extension()!.textColor, textStyle: TextStyle( - color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), prefixIcon: Padding( padding: EdgeInsets.only( @@ -75,10 +78,7 @@ class CurrencyInputField extends StatelessWidget { style: TextStyle( fontWeight: FontWeight.w600, fontSize: 16, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), ), if (selectedCurrency.tag != null) @@ -86,7 +86,7 @@ class CurrencyInputField extends StatelessWidget { padding: const EdgeInsets.only(right: 3.0), child: Container( decoration: BoxDecoration( - color: Theme.of(context).primaryTextTheme!.headlineMedium!.color!, + color: Theme.of(context).extension()!.textFieldButtonColor, borderRadius: BorderRadius.all( Radius.circular(6), ), @@ -97,10 +97,7 @@ class CurrencyInputField extends StatelessWidget { style: TextStyle( fontSize: 12, fontWeight: FontWeight.bold, - color: Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .decorationColor!, + color: Theme.of(context).extension()!.textFieldButtonIconColor, ), ), ), @@ -113,10 +110,7 @@ class CurrencyInputField extends StatelessWidget { style: TextStyle( fontWeight: FontWeight.w600, fontSize: 20, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), ), ), diff --git a/lib/src/screens/receive/widgets/header_tile.dart b/lib/src/screens/receive/widgets/header_tile.dart index ef9cd7779..e9c134ea5 100644 --- a/lib/src/screens/receive/widgets/header_tile.dart +++ b/lib/src/screens/receive/widgets/header_tile.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; class HeaderTile extends StatelessWidget { HeaderTile({ @@ -22,7 +23,7 @@ class HeaderTile extends StatelessWidget { top: 24, bottom: 24 ), - color: Theme.of(context).textTheme!.displaySmall!.decorationColor!, + color: Theme.of(context).extension()!.tilesBackgroundColor, child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -32,17 +33,14 @@ class HeaderTile extends StatelessWidget { style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, - color: Theme.of(context)!.textTheme.displaySmall!.color!), + color: Theme.of(context).extension()!.tilesTextColor), ), Container( height: 32, width: 32, decoration: BoxDecoration( shape: BoxShape.circle, - color: Theme.of(context) - .textTheme! - .headlineMedium! - .decorationColor!), + color: Theme.of(context).extension()!.iconsBackgroundColor), child: icon, ) ], @@ -50,4 +48,4 @@ class HeaderTile extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/src/screens/receive/widgets/qr_widget.dart b/lib/src/screens/receive/widgets/qr_widget.dart index 70a8e48bc..0d2a7c80d 100644 --- a/lib/src/screens/receive/widgets/qr_widget.dart +++ b/lib/src/screens/receive/widgets/qr_widget.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/entities/qr_view_data.dart'; +import 'package:cake_wallet/themes/extensions/qr_code_theme.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart'; import 'package:cake_wallet/src/screens/receive/widgets/currency_input_field.dart'; @@ -12,6 +13,7 @@ import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart'; import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; class QRWidget extends StatelessWidget { QRWidget({ @@ -35,7 +37,7 @@ class QRWidget extends StatelessWidget { @override Widget build(BuildContext context) { final copyImage = Image.asset('assets/images/copy_address.png', - color: Theme.of(context).textTheme!.titleMedium!.decorationColor!); + color: Theme.of(context).extension()!.qrWidgetCopyButtonColor); return Column( mainAxisSize: MainAxisSize.min, @@ -51,10 +53,7 @@ class QRWidget extends StatelessWidget { style: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!), + color: Theme.of(context).extension()!.textColor), ), ), Row( @@ -85,10 +84,7 @@ class QRWidget extends StatelessWidget { decoration: BoxDecoration( border: Border.all( width: 3, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), ), child: Container( @@ -152,10 +148,7 @@ class QRWidget extends StatelessWidget { style: TextStyle( fontSize: 15, fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!), + color: Theme.of(context).extension()!.textColor), ), ), Padding( diff --git a/lib/src/screens/release_notes/release_notes_screen.dart b/lib/src/screens/release_notes/release_notes_screen.dart index f72a85a3e..999abc142 100644 --- a/lib/src/screens/release_notes/release_notes_screen.dart +++ b/lib/src/screens/release_notes/release_notes_screen.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:cake_wallet/src/widgets/alert_background.dart'; import 'package:cake_wallet/src/widgets/alert_close_button.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; import 'package:cake_wallet/wallet_type_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -33,8 +34,8 @@ class ReleaseNotesScreen extends StatelessWidget { decoration: BoxDecoration( borderRadius: BorderRadius.circular(30.0), gradient: LinearGradient(colors: [ - Theme.of(context).colorScheme.secondary, - Theme.of(context).scaffoldBackgroundColor, + Theme.of(context).extension()!.firstGradientBackgroundColor, + Theme.of(context).extension()!.secondGradientBackgroundColor, ], begin: Alignment.centerLeft, end: Alignment.centerRight)), child: Padding( padding: const EdgeInsets.symmetric(horizontal: 24.0), @@ -51,10 +52,7 @@ class ReleaseNotesScreen extends StatelessWidget { fontSize: 24.0, fontWeight: FontWeight.bold, fontFamily: 'Lato', - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), child: Text(title), ), @@ -121,10 +119,7 @@ class ReleaseNotesScreen extends StatelessWidget { decoration: TextDecoration.none, fontSize: 16.0, fontFamily: 'Lato', - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), child: Row( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/src/screens/rescan/rescan_page.dart b/lib/src/screens/rescan/rescan_page.dart index 58c51ae5b..3a0ba2473 100644 --- a/lib/src/screens/rescan/rescan_page.dart +++ b/lib/src/screens/rescan/rescan_page.dart @@ -35,10 +35,7 @@ class RescanPage extends BasePage { _blockchainHeightWidgetKey.currentState!.height); Navigator.of(context).pop(); }, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, isDisabled: !_rescanViewModel.isButtonEnabled, )) diff --git a/lib/src/screens/restore/restore_from_backup_page.dart b/lib/src/screens/restore/restore_from_backup_page.dart index a057dd131..bf944a6e1 100644 --- a/lib/src/screens/restore/restore_from_backup_page.dart +++ b/lib/src/screens/restore/restore_from_backup_page.dart @@ -75,10 +75,7 @@ class RestoreFromBackupPage extends BasePage { restoreFromBackupViewModel.state is IsExecutingState, onPressed: () => onImportHandler(context), text: S.of(context).import, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white); })) ])), diff --git a/lib/src/screens/restore/restore_wallet_from_seed_details.dart b/lib/src/screens/restore/restore_wallet_from_seed_details.dart index d13606fa1..8d08c441d 100644 --- a/lib/src/screens/restore/restore_wallet_from_seed_details.dart +++ b/lib/src/screens/restore/restore_wallet_from_seed_details.dart @@ -134,10 +134,7 @@ class _RestoreFromSeedDetailsFormState isLoading: widget.walletRestorationFromSeedVM.state is IsExecutingState, text: S.of(context).restore_recover, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, isDisabled: _nameController.text.isNotEmpty, ); diff --git a/lib/src/screens/restore/sweeping_wallet_page.dart b/lib/src/screens/restore/sweeping_wallet_page.dart index 96887b955..75fccf638 100644 --- a/lib/src/screens/restore/sweeping_wallet_page.dart +++ b/lib/src/screens/restore/sweeping_wallet_page.dart @@ -1,8 +1,10 @@ import 'package:cake_wallet/themes/theme_base.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:flutter/scheduler.dart'; +import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; class SweepingWalletPage extends BasePage { SweepingWalletPage(); @@ -82,10 +84,7 @@ class _SweepingWalletWidgetState extends State { style: TextStyle( fontSize: 18, fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .color, + color: Theme.of(context).extension()!.hintTextColor, ), textAlign: TextAlign.center, ), @@ -97,10 +96,7 @@ class _SweepingWalletWidgetState extends State { style: TextStyle( fontSize: 36, fontWeight: FontWeight.bold, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!, + color: Theme.of(context).extension()!.titleColor, ), textAlign: TextAlign.center, ), @@ -112,10 +108,7 @@ class _SweepingWalletWidgetState extends State { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .color, + color: Theme.of(context).extension()!.hintTextColor, ), textAlign: TextAlign.center, ), 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 732bd650e..4712cfb10 100644 --- a/lib/src/screens/restore/wallet_restore_from_keys_form.dart +++ b/lib/src/screens/restore/wallet_restore_from_keys_form.dart @@ -10,6 +10,7 @@ import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/core/wallet_name_validator.dart'; import 'package:cake_wallet/entities/generate_name.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class WalletRestoreFromKeysFrom extends StatefulWidget { WalletRestoreFromKeysFrom({ @@ -89,10 +90,7 @@ class WalletRestoreFromKeysFromState extends State { height: 34, child: Image.asset( 'assets/images/refresh_icon.png', - color: Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .decorationColor!, + color: Theme.of(context).extension()!.textFieldButtonIconColor, ), ), ), diff --git a/lib/src/screens/restore/wallet_restore_from_seed_form.dart b/lib/src/screens/restore/wallet_restore_from_seed_form.dart index eeba53b04..d10277ced 100644 --- a/lib/src/screens/restore/wallet_restore_from_seed_form.dart +++ b/lib/src/screens/restore/wallet_restore_from_seed_form.dart @@ -11,6 +11,7 @@ import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/core/wallet_name_validator.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class WalletRestoreFromSeedForm extends StatefulWidget { WalletRestoreFromSeedForm( @@ -93,10 +94,7 @@ class WalletRestoreFromSeedFormState extends State { height: 34, child: Image.asset( 'assets/images/refresh_icon.png', - color: Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .decorationColor!, + color: Theme.of(context).extension()!.textFieldButtonIconColor, ), ), ), diff --git a/lib/src/screens/restore/wallet_restore_page.dart b/lib/src/screens/restore/wallet_restore_page.dart index 6adf9b858..10b5a521d 100644 --- a/lib/src/screens/restore/wallet_restore_page.dart +++ b/lib/src/screens/restore/wallet_restore_page.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/src/widgets/keyboard_done_button.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; @@ -22,6 +24,7 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/core/seed_validator.dart'; import 'package:cake_wallet/view_model/restore/restore_mode.dart'; +import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; class WalletRestorePage extends BasePage { WalletRestorePage(this.walletRestoreViewModel) @@ -91,8 +94,7 @@ class WalletRestorePage extends BasePage { fontSize: 18.0, fontWeight: FontWeight.bold, fontFamily: 'Lato', - color: titleColor ?? - Theme.of(context).primaryTextTheme!.titleLarge!.color!), + color: titleColor(context)), )); final WalletRestoreViewModel walletRestoreViewModel; @@ -139,10 +141,7 @@ class WalletRestorePage extends BasePage { return KeyboardActions( config: KeyboardActionsConfig( keyboardActionsPlatform: KeyboardActionsPlatform.IOS, - keyboardBarColor: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .backgroundColor!, + keyboardBarColor: Theme.of(context).extension()!.keyboardBarColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -194,14 +193,8 @@ class WalletRestorePage extends BasePage { return LoadingPrimaryButton( onPressed: _confirmForm, text: S.of(context).restore_recover, - color: Theme.of(context) - .accentTextTheme! - .titleSmall! - .decorationColor!, - textColor: Theme.of(context) - .accentTextTheme! - .headlineSmall! - .decorationColor!, + color: Theme.of(context).extension()!.createNewWalletButtonBackgroundColor, + textColor: Theme.of(context).extension()!.restoreWalletButtonTextColor, isLoading: walletRestoreViewModel.state is IsExecutingState, isDisabled: !walletRestoreViewModel.isButtonEnabled, ); diff --git a/lib/src/screens/restore/widgets/restore_button.dart b/lib/src/screens/restore/widgets/restore_button.dart index 817ebbc72..221dc37a2 100644 --- a/lib/src/screens/restore/widgets/restore_button.dart +++ b/lib/src/screens/restore/widgets/restore_button.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class RestoreButton extends StatelessWidget { const RestoreButton( diff --git a/lib/src/screens/seed/pre_seed_page.dart b/lib/src/screens/seed/pre_seed_page.dart index f1e7a0334..a2916d642 100644 --- a/lib/src/screens/seed/pre_seed_page.dart +++ b/lib/src/screens/seed/pre_seed_page.dart @@ -1,3 +1,6 @@ +import 'package:cake_wallet/utils/responsive_layout_util.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/generated/i18n.dart'; @@ -52,7 +55,7 @@ class PreSeedPage extends BasePage { style: TextStyle( fontSize: 14, fontWeight: FontWeight.normal, - color: Theme.of(context).primaryTextTheme.bodySmall!.color!), + color: Theme.of(context).extension()!.secondaryTextColor), ), ), PrimaryButton( diff --git a/lib/src/screens/seed/wallet_seed_page.dart b/lib/src/screens/seed/wallet_seed_page.dart index b3128375c..fa17d7ccf 100644 --- a/lib/src/screens/seed/wallet_seed_page.dart +++ b/lib/src/screens/seed/wallet_seed_page.dart @@ -1,4 +1,6 @@ import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/pin_code_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/utils/clipboard_util.dart'; @@ -13,6 +15,7 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/view_model/wallet_seed_view_model.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class WalletSeedPage extends BasePage { WalletSeedPage(this.walletSeedViewModel, {required this.isNewWalletCreated}); @@ -67,11 +70,13 @@ class WalletSeedPage extends BasePage { margin: EdgeInsets.only(left: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(16)), - color: Theme.of(context).accentTextTheme.bodySmall!.color!), + color: Theme.of(context).cardColor), child: Text( S.of(context).seed_language_next, style: TextStyle( - fontSize: 14, fontWeight: FontWeight.w600, color: Palette.blueCraiola), + fontSize: 14, fontWeight: FontWeight.w600, color: Theme.of(context) + .extension()! + .buttonTextColor), ), ), ) @@ -105,7 +110,7 @@ class WalletSeedPage extends BasePage { style: TextStyle( fontSize: 20, fontWeight: FontWeight.w600, - color: Theme.of(context).primaryTextTheme.titleLarge!.color!), + color: Theme.of(context).extension()!.titleColor), ), Padding( padding: EdgeInsets.only(top: 20, left: 16, right: 16), @@ -115,7 +120,7 @@ class WalletSeedPage extends BasePage { style: TextStyle( fontSize: 14, fontWeight: FontWeight.normal, - color: Theme.of(context).primaryTextTheme.bodySmall!.color!), + color: Theme.of(context).extension()!.secondaryTextColor), ), ) ], @@ -132,7 +137,7 @@ class WalletSeedPage extends BasePage { style: TextStyle( fontSize: 12, fontWeight: FontWeight.normal, - color: Theme.of(context).primaryTextTheme.labelSmall!.color!), + color: Theme.of(context).extension()!.detailsTitlesColor), ), ) : Offstage(), @@ -164,7 +169,7 @@ class WalletSeedPage extends BasePage { showBar(context, S.of(context).copied_to_clipboard); }, text: S.of(context).copy, - color: Theme.of(context).accentTextTheme.bodyMedium!.color!, + color: Theme.of(context).extension()!.indicatorsColor, textColor: Colors.white)), )) ], diff --git a/lib/src/screens/seed_language/seed_language_page.dart b/lib/src/screens/seed_language/seed_language_page.dart index 287a1ef07..b15da0375 100644 --- a/lib/src/screens/seed_language/seed_language_page.dart +++ b/lib/src/screens/seed_language/seed_language_page.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/src/widgets/seed_language_selector.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; @@ -67,7 +68,7 @@ class SeedLanguageFormState extends State { fontSize: 16.0, fontWeight: FontWeight.w500, color: - Theme.of(context).primaryTextTheme!.titleLarge!.color!), + Theme.of(context).extension()!.titleColor), ), ), Padding( diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart index c32fa6f35..dab78f3ef 100644 --- a/lib/src/screens/send/send_page.dart +++ b/lib/src/screens/send/send_page.dart @@ -7,6 +7,8 @@ import 'package:cake_wallet/src/widgets/add_template_button.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/src/widgets/picker.dart'; import 'package:cake_wallet/src/widgets/template_tile.dart'; +import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/utils/payment_request.dart'; import 'package:cake_wallet/utils/request_review_handler.dart'; @@ -49,7 +51,7 @@ class SendPage extends BasePage { String get title => S.current.send; @override - Color get titleColor => Colors.white; + bool get gradientAll => true; @override bool get resizeToAvoidBottomInset => false; @@ -61,7 +63,7 @@ class SendPage extends BasePage { Widget? leading(BuildContext context) { final _backButton = Icon( Icons.arrow_back_ios, - color: titleColor, + color: titleColor(context), size: 16, ); final _closeButton = currentTheme.type == ThemeType.dark @@ -403,7 +405,7 @@ class SendPage extends BasePage { }, text: S.of(context).send, color: - Theme.of(context).accentTextTheme!.bodyLarge!.color!, + Theme.of(context).primaryColor, textColor: Colors.white, isLoading: sendViewModel.state is IsExecutingState || sendViewModel.state is TransactionCommitting, diff --git a/lib/src/screens/send/send_template_page.dart b/lib/src/screens/send/send_template_page.dart index fb06f00ee..205fd62e1 100644 --- a/lib/src/screens/send/send_template_page.dart +++ b/lib/src/screens/send/send_template_page.dart @@ -1,3 +1,7 @@ +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; +import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart'; +import 'package:cake_wallet/utils/payment_request.dart'; import 'package:cake_wallet/src/widgets/trail_button.dart'; import 'package:cake_wallet/view_model/send/template_view_model.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; @@ -7,6 +11,8 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/view_model/send/send_template_view_model.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; +import 'package:cake_wallet/src/screens/send/widgets/prefix_currency_icon_widget.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; import 'package:cake_wallet/src/screens/send/widgets/send_template_card.dart'; import 'package:smooth_page_indicator/smooth_page_indicator.dart'; @@ -21,10 +27,10 @@ class SendTemplatePage extends BasePage { String get title => S.current.exchange_new_template; @override - Color get titleColor => Colors.white; + bool get extendBodyBehindAppBar => true; @override - bool get extendBodyBehindAppBar => true; + bool get gradientAll => true; @override AppBarStyle get appBarStyle => AppBarStyle.transparent; @@ -91,14 +97,8 @@ class SendTemplatePage extends BasePage { radius: 6.0, dotWidth: 6.0, dotHeight: 6.0, - dotColor: Theme.of(context) - .primaryTextTheme - .displaySmall! - .backgroundColor!, - activeDotColor: Theme.of(context) - .primaryTextTheme - .displayMedium! - .backgroundColor!)) + dotColor: Theme.of(context).extension()!.indicatorDotColor, + activeDotColor: Theme.of(context).extension()!.indicatorDotTheme.activeIndicatorColor)) : Offstage(); }, ), @@ -119,10 +119,10 @@ class SendTemplatePage extends BasePage { }, text: S.of(context).add_receiver, color: Colors.transparent, - textColor: Theme.of(context).accentTextTheme.displaySmall!.decorationColor!, + textColor: Theme.of(context).extension()!.hintTextColor, isDottedBorder: true, borderColor: - Theme.of(context).primaryTextTheme.displaySmall!.decorationColor!)), + Theme.of(context).extension()!.templateBackgroundColor)), PrimaryButton( onPressed: () { if (_formKey.currentState != null && _formKey.currentState!.validate()) { @@ -145,7 +145,7 @@ class SendTemplatePage extends BasePage { } }, text: S.of(context).save, - color: Colors.green, + color: Theme.of(context).primaryColor, textColor: Colors.white) ]))); } diff --git a/lib/src/screens/send/widgets/choose_yat_address_alert.dart b/lib/src/screens/send/widgets/choose_yat_address_alert.dart index f18c116f6..00f93ff4b 100644 --- a/lib/src/screens/send/widgets/choose_yat_address_alert.dart +++ b/lib/src/screens/send/widgets/choose_yat_address_alert.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/src/widgets/cake_scrollbar.dart'; import 'package:cake_wallet/src/widgets/section_divider.dart'; import 'package:flutter/material.dart'; @@ -66,12 +67,12 @@ class ChooseYatAddressButtonsState extends State { Container( width: 300, height: 158, - color: Theme.of(context).accentTextTheme!.bodyMedium!.backgroundColor!, + color: Theme.of(context).dialogBackgroundColor, child: ListView.separated( controller: controller, padding: EdgeInsets.all(0), itemCount: itemCount, - separatorBuilder: (_, __) => const SectionDivider(), + separatorBuilder: (_, __) => const HorizontalSectionDivider(), itemBuilder: (context, index) { final address = addresses[index]; @@ -95,7 +96,7 @@ class ChooseYatAddressButtonsState extends State { fontSize: 15, fontWeight: FontWeight.w600, fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ) diff --git a/lib/src/screens/send/widgets/confirm_sending_alert.dart b/lib/src/screens/send/widgets/confirm_sending_alert.dart index 775971fe8..7f74f54a2 100644 --- a/lib/src/screens/send/widgets/confirm_sending_alert.dart +++ b/lib/src/screens/send/widgets/confirm_sending_alert.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/view_model/send/output.dart'; import 'package:flutter/material.dart'; @@ -205,8 +206,7 @@ class ConfirmSendingAlertContentState extends State fontSize: 16, fontWeight: FontWeight.normal, fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme! - .titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ), @@ -219,8 +219,7 @@ class ConfirmSendingAlertContentState extends State fontSize: 18, fontWeight: FontWeight.w600, fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme! - .titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ), @@ -240,10 +239,7 @@ class ConfirmSendingAlertContentState extends State fontSize: 16, fontWeight: FontWeight.normal, fontFamily: 'Lato', - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ), @@ -256,10 +252,7 @@ class ConfirmSendingAlertContentState extends State fontSize: 18, fontWeight: FontWeight.w600, fontFamily: 'Lato', - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ), @@ -290,7 +283,7 @@ class ConfirmSendingAlertContentState extends State fontSize: 16, fontWeight: FontWeight.normal, fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ), @@ -303,7 +296,7 @@ class ConfirmSendingAlertContentState extends State fontSize: 18, fontWeight: FontWeight.w600, fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ), @@ -332,10 +325,7 @@ class ConfirmSendingAlertContentState extends State fontSize: 16, fontWeight: FontWeight.normal, fontFamily: 'Lato', - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ), diff --git a/lib/src/screens/send/widgets/prefix_currency_icon_widget.dart b/lib/src/screens/send/widgets/prefix_currency_icon_widget.dart index 6e2428857..d30349066 100644 --- a/lib/src/screens/send/widgets/prefix_currency_icon_widget.dart +++ b/lib/src/screens/send/widgets/prefix_currency_icon_widget.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; import 'package:flutter/material.dart'; class PrefixCurrencyIcon extends StatelessWidget { @@ -23,7 +24,11 @@ class PrefixCurrencyIcon extends StatelessWidget { padding: EdgeInsets.symmetric(vertical: 4, horizontal: 8), decoration: BoxDecoration( borderRadius: BorderRadius.circular(26), - color: isSelected ? Colors.green : Colors.transparent, + color: isSelected + ? Theme.of(context) + .extension()! + .templateSelectedCurrencyBackgroundColor + : Colors.transparent, ), child: Row( mainAxisSize: MainAxisSize.min, @@ -42,7 +47,11 @@ class PrefixCurrencyIcon extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Colors.white, + color: isSelected + ? Theme.of(context) + .extension()! + .templateSelectedCurrencyTitleColor + : Colors.white, ), ), ], diff --git a/lib/src/screens/send/widgets/send_card.dart b/lib/src/screens/send/widgets/send_card.dart index 8cdcd6dac..5e5bf44d3 100644 --- a/lib/src/screens/send/widgets/send_card.dart +++ b/lib/src/screens/send/widgets/send_card.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; import 'package:cake_wallet/entities/priority_for_wallet_type.dart'; import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; @@ -20,6 +21,7 @@ import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/src/widgets/address_text_field.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class SendCard extends StatefulWidget { SendCard({ @@ -101,7 +103,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.keyboardBarColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -126,8 +128,8 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.firstGradientColor, + Theme.of(context).extension()!.secondGradientColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight, @@ -173,7 +175,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.textFieldHintColor), onPushPasteButton: (context) async { output.resetParsedAddress(); await output.fetchParsedAddress(context); @@ -194,7 +196,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.textFieldBorderColor, textStyle: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white), validator: sendViewModel.addressValidator)), @@ -249,10 +251,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.textFieldButtonColor, borderRadius: BorderRadius.all( Radius.circular(6), )), @@ -264,10 +263,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.textFieldButtonIconColor), ), ), ), @@ -308,10 +304,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.textFieldHintColor, fontWeight: FontWeight.w500, fontSize: 14), validator: output.sendAll @@ -329,10 +322,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin output.setSendAll(), child: Container( decoration: BoxDecoration( - color: Theme.of(context) - .primaryTextTheme - .headlineMedium! - .color!, + color: Theme.of(context).extension()!.textFieldButtonColor, borderRadius: BorderRadius.all( Radius.circular(6), ), @@ -344,10 +334,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.textFieldButtonIconColor, ), ), ), @@ -363,7 +350,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.textFieldHintColor), Observer( builder: (_) => Padding( padding: EdgeInsets.only(top: 10), @@ -377,10 +364,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.textFieldHintColor), ), ), Text( @@ -388,10 +372,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.textFieldHintColor), ) ], ), @@ -448,7 +429,7 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin()!.textFieldHintColor), ), ), Observer( @@ -465,7 +446,6 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin with AutomaticKeepAliveClientMixin with AutomaticKeepAliveClientMixin()!.textFieldHintColor, ), ), ), diff --git a/lib/src/screens/send/widgets/send_template_card.dart b/lib/src/screens/send/widgets/send_template_card.dart index 54538ce5d..fbc7e659d 100644 --- a/lib/src/screens/send/widgets/send_template_card.dart +++ b/lib/src/screens/send/widgets/send_template_card.dart @@ -1,5 +1,6 @@ import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart'; import 'package:cake_wallet/src/screens/send/widgets/prefix_currency_icon_widget.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; import 'package:cake_wallet/utils/payment_request.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/send/template_view_model.dart'; @@ -43,8 +44,8 @@ class SendTemplateCard extends StatelessWidget { borderRadius: BorderRadius.only(bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)), gradient: LinearGradient(colors: [ - Theme.of(context).primaryTextTheme.titleMedium!.color!, - Theme.of(context).primaryTextTheme.titleMedium!.decorationColor! + Theme.of(context).extension()!.firstGradientColor, + Theme.of(context).extension()!.secondGradientColor ], begin: Alignment.topLeft, end: Alignment.bottomRight)), child: Column( children: [ @@ -58,11 +59,11 @@ class SendTemplateCard extends StatelessWidget { hintText: sendTemplateViewModel.recipients.length > 1 ? S.of(context).template_name : S.of(context).send_name, - borderColor: Theme.of(context).primaryTextTheme.headlineSmall!.color!, + borderColor: Theme.of(context).extension()!.textFieldBorderColor, textStyle: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white), placeholderTextStyle: TextStyle( - color: Theme.of(context).primaryTextTheme.headlineSmall!.decorationColor!, + color: Theme.of(context).extension()!.textFieldHintColor, fontWeight: FontWeight.w500, fontSize: 14), validator: sendTemplateViewModel.templateValidator), @@ -89,8 +90,8 @@ class SendTemplateCard extends StatelessWidget { template.output.resetParsedAddress(); await template.output.fetchParsedAddress(context); }, - buttonColor: Theme.of(context).primaryTextTheme.headlineMedium!.color!, - borderColor: Theme.of(context).primaryTextTheme.headlineSmall!.color!, + buttonColor: Theme.of(context).extension()!.textFieldButtonColor, + borderColor: Theme.of(context).extension()!.textFieldBorderColor, textStyle: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, @@ -99,7 +100,7 @@ class SendTemplateCard extends StatelessWidget { hintStyle: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, - color: Theme.of(context).primaryTextTheme.headlineSmall!.decorationColor!, + color: Theme.of(context).extension()!.textFieldHintColor, ), validator: sendTemplateViewModel.addressValidator, ), @@ -127,11 +128,11 @@ class SendTemplateCard extends StatelessWidget { ), ), hintText: '0.0000', - borderColor: Theme.of(context).primaryTextTheme.headlineSmall!.color!, + borderColor: Theme.of(context).extension()!.textFieldBorderColor, textStyle: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white), placeholderTextStyle: TextStyle( - color: Theme.of(context).primaryTextTheme.headlineSmall!.decorationColor!, + color: Theme.of(context).extension()!.textFieldHintColor, fontWeight: FontWeight.w500, fontSize: 14), validator: sendTemplateViewModel.amountValidator, @@ -156,11 +157,11 @@ class SendTemplateCard extends StatelessWidget { title: sendTemplateViewModel.fiatCurrency, isSelected: template.isFiatSelected)), hintText: '0.00', - borderColor: Theme.of(context).primaryTextTheme.headlineSmall!.color!, + borderColor: Theme.of(context).extension()!.textFieldBorderColor, textStyle: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white), placeholderTextStyle: TextStyle( - color: Theme.of(context).primaryTextTheme.headlineSmall!.decorationColor!, + color: Theme.of(context).extension()!.textFieldHintColor, fontWeight: FontWeight.w500, fontSize: 14, ), diff --git a/lib/src/screens/settings/desktop_settings/desktop_settings_page.dart b/lib/src/screens/settings/desktop_settings/desktop_settings_page.dart index dabdafb64..bcdb89aec 100644 --- a/lib/src/screens/settings/desktop_settings/desktop_settings_page.dart +++ b/lib/src/screens/settings/desktop_settings/desktop_settings_page.dart @@ -5,6 +5,7 @@ import 'package:cake_wallet/src/widgets/setting_actions.dart'; import 'package:cake_wallet/typography.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/router.dart' as Router; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; final _settingsNavigatorKey = GlobalKey(); @@ -71,10 +72,7 @@ class _DesktopSettingsPageState extends State { }, separatorBuilder: (_, index) => Container( height: 1, - color: Theme.of(context) - .primaryTextTheme! - .bodySmall! - .decorationColor!, + color: Theme.of(context).extension()!.dividerColor, ), itemCount: itemCount, ), diff --git a/lib/src/screens/settings/display_settings_page.dart b/lib/src/screens/settings/display_settings_page.dart index 04fd134e6..6e572abe0 100644 --- a/lib/src/screens/settings/display_settings_page.dart +++ b/lib/src/screens/settings/display_settings_page.dart @@ -2,14 +2,11 @@ import 'package:cake_wallet/entities/fiat_currency.dart'; import 'package:cake_wallet/entities/language_service.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; -import 'package:cake_wallet/src/screens/settings/widgets/settings_choices_cell.dart'; import 'package:cake_wallet/src/screens/settings/widgets/settings_picker_cell.dart'; import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart'; -import 'package:cake_wallet/themes/theme_base.dart'; -import 'package:cake_wallet/themes/theme_list.dart'; +import 'package:cake_wallet/src/screens/settings/widgets/settings_theme_choice.dart'; import 'package:cake_wallet/utils/device_info.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; -import 'package:cake_wallet/view_model/settings/choices_list_item.dart'; import 'package:cake_wallet/view_model/settings/display_settings_view_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; @@ -78,14 +75,7 @@ class DisplaySettingsPage extends BasePage { }, ), if (ResponsiveLayoutUtil.instance.isMobile && DeviceInfo.instance.isMobile) - SettingsChoicesCell( - ChoicesListItem( - title: S.current.color_theme, - items: ThemeList.all, - selectedItem: _displaySettingsViewModel.theme, - onItemSelected: (ThemeBase theme) => _displaySettingsViewModel.setTheme(theme), - ), - ), + SettingsThemeChoicesCell(_displaySettingsViewModel), ], ), ); diff --git a/lib/src/screens/settings/manage_nodes_page.dart b/lib/src/screens/settings/manage_nodes_page.dart index d4c4507e6..0a67f0502 100644 --- a/lib/src/screens/settings/manage_nodes_page.dart +++ b/lib/src/screens/settings/manage_nodes_page.dart @@ -37,12 +37,11 @@ class ManageNodesPage extends BasePage { return Flexible( child: SectionStandardList( sectionCount: 1, - context: context, dividerPadding: EdgeInsets.symmetric(horizontal: 24), itemCounter: (int sectionIndex) { return nodeListViewModel.nodes.length; }, - itemBuilder: (_, sectionIndex, index) { + itemBuilder: (_, index) { final node = nodeListViewModel.nodes[index]; final isSelected = node.keyIndex == nodeListViewModel.currentNode.keyIndex; final nodeListRow = NodeListRow( diff --git a/lib/src/screens/settings/widgets/settings_cell_with_arrow.dart b/lib/src/screens/settings/widgets/settings_cell_with_arrow.dart index 163d59f4f..f0e19a715 100644 --- a/lib/src/screens/settings/widgets/settings_cell_with_arrow.dart +++ b/lib/src/screens/settings/widgets/settings_cell_with_arrow.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:cake_wallet/src/widgets/standard_list.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class SettingsCellWithArrow extends StandardListRow { SettingsCellWithArrow({required String title, required Function(BuildContext context)? handler}) @@ -7,5 +8,5 @@ class SettingsCellWithArrow extends StandardListRow { @override Widget buildTrailing(BuildContext context) => Image.asset('assets/images/select_arrow.png', - color: Theme.of(context).primaryTextTheme.labelSmall!.color!); + color: Theme.of(context).extension()!.detailsTitlesColor); } diff --git a/lib/src/screens/settings/widgets/settings_choices_cell.dart b/lib/src/screens/settings/widgets/settings_choices_cell.dart index c03c923c3..4d4addb99 100644 --- a/lib/src/screens/settings/widgets/settings_choices_cell.dart +++ b/lib/src/screens/settings/widgets/settings_choices_cell.dart @@ -1,10 +1,12 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/view_model/settings/choices_list_item.dart'; import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/address_theme.dart'; class SettingsChoicesCell extends StatelessWidget { const SettingsChoicesCell(this.choicesListItem, {Key? key}) : super(key: key); - final ChoicesListItem choicesListItem; + final ChoicesListItem choicesListItem; @override Widget build(BuildContext context) { @@ -22,7 +24,7 @@ class SettingsChoicesCell extends StatelessWidget { style: TextStyle( fontSize: 14, fontWeight: FontWeight.normal, - color: Theme.of(context).primaryTextTheme.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), ), ], @@ -34,7 +36,7 @@ class SettingsChoicesCell extends StatelessWidget { child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(30), - color: Theme.of(context).accentTextTheme.displaySmall!.color!, + color: Theme.of(context).extension()!.actionButtonColor, ), child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -42,18 +44,18 @@ class SettingsChoicesCell extends StatelessWidget { final isSelected = choicesListItem.selectedItem == e; return GestureDetector( onTap: () { - choicesListItem.onItemSelected?.call(e); + choicesListItem.onItemSelected.call(e); }, child: Container( padding: EdgeInsets.symmetric(horizontal: 32, vertical: 8), decoration: BoxDecoration( borderRadius: BorderRadius.circular(30), color: isSelected - ? Theme.of(context).accentTextTheme.bodyLarge!.color! + ? Theme.of(context).primaryColor : null, ), child: Text( - choicesListItem.displayItem?.call(e) ?? e.toString(), + choicesListItem.displayItem.call(e), style: TextStyle( color: isSelected ? Colors.white diff --git a/lib/src/screens/settings/widgets/settings_link_provider_cell.dart b/lib/src/screens/settings/widgets/settings_link_provider_cell.dart index e64d6543b..6e5d48a69 100644 --- a/lib/src/screens/settings/widgets/settings_link_provider_cell.dart +++ b/lib/src/screens/settings/widgets/settings_link_provider_cell.dart @@ -27,7 +27,7 @@ class SettingsLinkProviderCell extends StandardListRow { style: TextStyle( fontSize: 14.0, fontWeight: FontWeight.w500, - color: Palette.blueCraiola)); + color: Theme.of(context).primaryColor)); static void _launchUrl(String url) async { try { diff --git a/lib/src/screens/settings/widgets/settings_picker_cell.dart b/lib/src/screens/settings/widgets/settings_picker_cell.dart index 64086d8d1..8e0492330 100644 --- a/lib/src/screens/settings/widgets/settings_picker_cell.dart +++ b/lib/src/screens/settings/widgets/settings_picker_cell.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/src/widgets/picker.dart'; @@ -55,7 +56,7 @@ class SettingsPickerCell extends StandardListRow { style: TextStyle( fontSize: 14.0, fontWeight: FontWeight.w500, - color: Theme.of(context).primaryTextTheme!.labelSmall?.color, + color: Theme.of(context).extension()!.detailsTitlesColor, ), ); } diff --git a/lib/src/screens/settings/widgets/settings_theme_choice.dart b/lib/src/screens/settings/widgets/settings_theme_choice.dart new file mode 100644 index 000000000..ffb9d7e7e --- /dev/null +++ b/lib/src/screens/settings/widgets/settings_theme_choice.dart @@ -0,0 +1,117 @@ +import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/theme_base.dart'; +import 'package:cake_wallet/themes/theme_list.dart'; +import 'package:cake_wallet/view_model/settings/display_settings_view_model.dart'; +import 'package:flutter/material.dart'; + +class SettingsThemeChoicesCell extends StatelessWidget { + SettingsThemeChoicesCell(this._displaySettingsViewModel); + + final items = ThemeList.all; + + final DisplaySettingsViewModel _displaySettingsViewModel; + + final double cellHeight = 25; + final double cellWidth = 12; + final double cellRadius = 6; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(cellHeight), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + S.current.color_theme, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + color: + Theme.of(context).extension()!.titleColor, + ), + ), + ], + ), + SizedBox(height: cellHeight), + GridView.builder( + itemCount: items.length, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + mainAxisExtent: 75, + crossAxisSpacing: 20, + ), + itemBuilder: (context, index) { + final ThemeBase e = items[index]; + final currentTheme = _displaySettingsViewModel.theme; + final isSelected = currentTheme == e; + + return Padding( + padding: EdgeInsets.all(5), + child: GestureDetector( + onTap: () { + _displaySettingsViewModel.setTheme(e); + }, + child: Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(cellRadius), + border: isSelected + ? Border.all( + color: Theme.of(context).primaryColor) + : null, + color: Theme.of(context) + .extension()! + .secondaryTextColor + .withOpacity( + currentTheme.brightness == Brightness.light + ? 0.1 + : 0.3), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.symmetric( + horizontal: cellWidth, vertical: cellHeight), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(cellRadius), + bottomLeft: Radius.circular(cellRadius)), + color: e.themeData.primaryColor, + ), + ), + Container( + padding: EdgeInsets.symmetric( + horizontal: cellWidth, vertical: cellHeight), + decoration: BoxDecoration( + color: e.themeData.colorScheme.background, + ), + ), + Container( + padding: EdgeInsets.symmetric( + horizontal: cellWidth, vertical: cellHeight), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topRight: Radius.circular(cellRadius), + bottomRight: Radius.circular(cellRadius)), + color: e.themeData.cardColor, + ), + ), + ], + ), + ), + ), + ); + }), + ], + ), + ); + } +} diff --git a/lib/src/screens/settings/widgets/settings_version_cell.dart b/lib/src/screens/settings/widgets/settings_version_cell.dart index e314d549d..8ab1a1672 100644 --- a/lib/src/screens/settings/widgets/settings_version_cell.dart +++ b/lib/src/screens/settings/widgets/settings_version_cell.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class SettingsVersionCell extends StatelessWidget { SettingsVersionCell({required this.title}); @@ -18,7 +19,7 @@ class SettingsVersionCell extends StatelessWidget { style: TextStyle( fontSize: 12, fontWeight: FontWeight.normal, - color: Theme.of(context).primaryTextTheme!.labelSmall!.color!), + color: Theme.of(context).extension()!.detailsTitlesColor), ) ], ), diff --git a/lib/src/screens/setup_2fa/setup_2fa.dart b/lib/src/screens/setup_2fa/setup_2fa.dart index 6c60dcd1e..a74152e4f 100644 --- a/lib/src/screens/setup_2fa/setup_2fa.dart +++ b/lib/src/screens/setup_2fa/setup_2fa.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/routes.dart'; @@ -33,7 +34,7 @@ class Setup2FAPage extends BasePage { fontWeight: FontWeight.w700, fontSize: 14, height: 1.571, - color: Theme.of(context).primaryTextTheme.headline6!.color!, + color: Theme.of(context).extension()!.titleColor, ), ), SizedBox(height: 16), @@ -43,7 +44,7 @@ class Setup2FAPage extends BasePage { fontWeight: FontWeight.w400, fontSize: 14, height: 1.571, - color: Theme.of(context).primaryTextTheme.headline6!.color!, + color: Theme.of(context).extension()!.titleColor, ), ), ], diff --git a/lib/src/screens/setup_2fa/setup_2fa_enter_code_page.dart b/lib/src/screens/setup_2fa/setup_2fa_enter_code_page.dart index c4bee2b12..70660c59d 100644 --- a/lib/src/screens/setup_2fa/setup_2fa_enter_code_page.dart +++ b/lib/src/screens/setup_2fa/setup_2fa_enter_code_page.dart @@ -203,7 +203,7 @@ class TOTPEnterCode extends BasePage { }, text: S.of(context).continue_text, - color: Theme.of(context).accentTextTheme.bodyLarge!.color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ); }, diff --git a/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart b/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart index b00d0eed8..82a079b39 100644 --- a/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart +++ b/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart @@ -6,6 +6,7 @@ import 'package:cake_wallet/src/widgets/standard_list.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/routes.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; import 'package:cake_wallet/utils/clipboard_util.dart'; import 'package:cake_wallet/utils/show_bar.dart'; import 'package:cake_wallet/view_model/set_up_2fa_viewmodel.dart'; @@ -53,7 +54,7 @@ class Setup2FAQRPage extends BasePage { decoration: BoxDecoration( border: Border.all( width: 3, - color: Theme.of(context).accentTextTheme.headline2!.backgroundColor!, + color: Theme.of(context).extension()!.textColor, ), ), child: Container( @@ -137,7 +138,7 @@ class Setup2FAQRPage extends BasePage { ); }, text: S.current.continue_text, - color: Theme.of(context).accentTextTheme.bodyLarge!.color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, ), SizedBox(height: 24), diff --git a/lib/src/screens/setup_2fa/widgets/popup_cancellable_alert.dart b/lib/src/screens/setup_2fa/widgets/popup_cancellable_alert.dart index fb8d26102..2535338e5 100644 --- a/lib/src/screens/setup_2fa/widgets/popup_cancellable_alert.dart +++ b/lib/src/screens/setup_2fa/widgets/popup_cancellable_alert.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/src/widgets/alert_close_button.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:flutter/material.dart'; @@ -30,7 +31,7 @@ class PopUpCancellableAlertDialog extends StatelessWidget { fontSize: 16, fontWeight: FontWeight.normal, fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ); @@ -55,7 +56,7 @@ class PopUpCancellableAlertDialog extends StatelessWidget { child: Container( width: 340, padding: EdgeInsets.all(10), - color: Theme.of(context).accentTextTheme.titleLarge!.decorationColor!, + color: Theme.of(context).dialogBackgroundColor, child: Column( mainAxisSize: MainAxisSize.min, children: [ diff --git a/lib/src/screens/subaddress/address_edit_or_create_page.dart b/lib/src/screens/subaddress/address_edit_or_create_page.dart index 86659130a..e067c78d0 100644 --- a/lib/src/screens/subaddress/address_edit_or_create_page.dart +++ b/lib/src/screens/subaddress/address_edit_or_create_page.dart @@ -53,10 +53,7 @@ class AddressEditOrCreatePage extends BasePage { text: addressEditOrCreateViewModel.isEdit ? S.of(context).rename : S.of(context).new_subaddress_create, - color: Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, isLoading: addressEditOrCreateViewModel.state is AddressIsSaving, diff --git a/lib/src/screens/support/widgets/support_tiles.dart b/lib/src/screens/support/widgets/support_tiles.dart index 9d7c65719..1db87953b 100644 --- a/lib/src/screens/support/widgets/support_tiles.dart +++ b/lib/src/screens/support/widgets/support_tiles.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; import 'package:flutter/material.dart'; class SupportTile extends StatelessWidget { @@ -22,7 +23,7 @@ class SupportTile extends StatelessWidget { alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(12)), - color: Theme.of(context).accentTextTheme.bodySmall!.color!, + color: Theme.of(context).cardColor, ), child: Row( mainAxisSize: MainAxisSize.max, @@ -43,7 +44,7 @@ class SupportTile extends StatelessWidget { style: TextStyle( fontSize: 20, fontWeight: FontWeight.w500, - color: Theme.of(context).primaryTextTheme.titleLarge!.color!, + color: Theme.of(context).dialogTheme.backgroundColor, ), ), Padding( @@ -53,7 +54,7 @@ class SupportTile extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.normal, - color: Theme.of(context).primaryTextTheme.labelSmall!.color!, + color: Theme.of(context).extension()!.detailsTitlesColor, ), ), ) diff --git a/lib/src/screens/support_other_links/support_other_links_page.dart b/lib/src/screens/support_other_links/support_other_links_page.dart index e904e7fab..681a44f8f 100644 --- a/lib/src/screens/support_other_links/support_other_links_page.dart +++ b/lib/src/screens/support_other_links/support_other_links_page.dart @@ -1,6 +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/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'; @@ -21,23 +22,20 @@ class SupportOtherLinksPage extends BasePage { @override Widget body(BuildContext context) { - final iconColor = - Theme.of(context).accentTextTheme.displayLarge!.backgroundColor!; + final iconColor = Theme.of(context).extension()!.iconColor; return Container( child: 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) { - return SettingsCellWithArrow( - title: item.title, handler: item.handler); + return SettingsCellWithArrow(title: item.title, handler: item.handler); } if (item is LinkListItem) { diff --git a/lib/src/screens/trade_details/trade_details_page.dart b/lib/src/screens/trade_details/trade_details_page.dart index 1958a7d58..17683c600 100644 --- a/lib/src/screens/trade_details/trade_details_page.dart +++ b/lib/src/screens/trade_details/trade_details_page.dart @@ -53,10 +53,9 @@ class TradeDetailsPageBodyState extends State { return Observer(builder: (_) { // FIX-ME: Added `context` it was not used here before, maby bug ? return SectionStandardList( - context: context, sectionCount: 1, itemCounter: (int _) => tradeDetailsViewModel.items.length, - itemBuilder: (_, __, index) { + itemBuilder: (__, index) { final item = tradeDetailsViewModel.items[index]; if (item is TrackTradeListItem) { diff --git a/lib/src/screens/transaction_details/transaction_details_page.dart b/lib/src/screens/transaction_details/transaction_details_page.dart index 1b79ceeb0..96f67424c 100644 --- a/lib/src/screens/transaction_details/transaction_details_page.dart +++ b/lib/src/screens/transaction_details/transaction_details_page.dart @@ -10,11 +10,6 @@ import 'package:cake_wallet/src/widgets/list_row.dart'; import 'package:cake_wallet/src/screens/transaction_details/blockexplorer_list_item.dart'; import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; -import 'package:cake_wallet/utils/date_formatter.dart'; - -import 'package:url_launcher/url_launcher.dart'; - -import 'package:hive/hive.dart'; class TransactionDetailsPage extends BasePage { TransactionDetailsPage({required this.transactionDetailsViewModel}); @@ -28,10 +23,9 @@ class TransactionDetailsPage extends BasePage { Widget body(BuildContext context) { // FIX-ME: Added `context` it was not used here before, maby bug ? return SectionStandardList( - context: context, sectionCount: 1, itemCounter: (int _) => transactionDetailsViewModel.items.length, - itemBuilder: (_, __, index) { + itemBuilder: (__, index) { final item = transactionDetailsViewModel.items[index]; if (item is StandartListItem) { diff --git a/lib/src/screens/transaction_details/widgets/textfield_list_row.dart b/lib/src/screens/transaction_details/widgets/textfield_list_row.dart index 18e5368a6..2c7934d19 100644 --- a/lib/src/screens/transaction_details/widgets/textfield_list_row.dart +++ b/lib/src/screens/transaction_details/widgets/textfield_list_row.dart @@ -1,5 +1,7 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class TextFieldListRow extends StatelessWidget { TextFieldListRow( @@ -34,10 +36,7 @@ class TextFieldListRow extends StatelessWidget { style: TextStyle( fontSize: titleFontSize, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .labelSmall! - .color!), + color: Theme.of(context).extension()!.detailsTitlesColor), textAlign: TextAlign.left), TextField( controller: _textController, @@ -49,7 +48,7 @@ class TextFieldListRow extends StatelessWidget { fontSize: valueFontSize, fontWeight: FontWeight.w500, color: - Theme.of(context).primaryTextTheme!.titleLarge!.color!), + Theme.of(context).extension()!.titleColor), decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only(top: 12, bottom: 0), @@ -57,10 +56,7 @@ class TextFieldListRow extends StatelessWidget { hintStyle: TextStyle( fontSize: valueFontSize, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .labelSmall! - .color!), + color: Theme.of(context).extension()!.detailsTitlesColor), border: InputBorder.none), onSubmitted: (value) => onSubmitted?.call(value), ) diff --git a/lib/src/screens/unspent_coins/unspent_coins_details_page.dart b/lib/src/screens/unspent_coins/unspent_coins_details_page.dart index 00c7b9796..dfa8e8435 100644 --- a/lib/src/screens/unspent_coins/unspent_coins_details_page.dart +++ b/lib/src/screens/unspent_coins/unspent_coins_details_page.dart @@ -26,10 +26,9 @@ class UnspentCoinsDetailsPage extends BasePage { Widget body(BuildContext context) { // FIX-ME: Added `context` it was not used here before, maby bug ? return SectionStandardList( - context: context, sectionCount: 1, itemCounter: (int _) => unspentCoinsDetailsViewModel.items.length, - itemBuilder: (_, __, index) { + itemBuilder: (__, index) { final item = unspentCoinsDetailsViewModel.items[index]; if (item is StandartListItem) { diff --git a/lib/src/screens/unspent_coins/unspent_coins_list_page.dart b/lib/src/screens/unspent_coins/unspent_coins_list_page.dart index 432fdc5f6..1c1fbfa5d 100644 --- a/lib/src/screens/unspent_coins/unspent_coins_list_page.dart +++ b/lib/src/screens/unspent_coins/unspent_coins_list_page.dart @@ -18,7 +18,7 @@ class UnspentCoinsListPage extends BasePage { //@override //Widget trailing(BuildContext context) { // final questionImage = Image.asset('assets/images/question_mark.png', - // color: Theme.of(context).primaryTextTheme!.titleLarge!.color!); + // color: Theme.of(context).extension()!.titleColor); // return SizedBox( // height: 20.0, diff --git a/lib/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart b/lib/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart index b1916d06c..154c3a2f5 100644 --- a/lib/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart +++ b/lib/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart @@ -1,8 +1,7 @@ import 'package:auto_size_text/auto_size_text.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/widgets/standard_checkbox.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; import 'package:cake_wallet/generated/i18n.dart'; class UnspentCoinsListItem extends StatelessWidget { @@ -15,11 +14,6 @@ class UnspentCoinsListItem extends StatelessWidget { this.onCheckBoxTap, }); - static const amountColor = Palette.darkBlueCraiola; - static const addressColor = Palette.darkGray; - static const selectedItemColor = Palette.paleCornflowerBlue; - static const unselectedItemColor = Palette.moderateLavender; - final String note; final String amount; final String address; @@ -29,7 +23,17 @@ class UnspentCoinsListItem extends StatelessWidget { @override Widget build(BuildContext context) { + final unselectedItemColor = Theme.of(context).cardColor; + final selectedItemColor = Theme.of(context).primaryColor; final itemColor = isSending ? selectedItemColor : unselectedItemColor; + + final amountColor = isSending + ? Colors.white + : Theme.of(context).extension()!.buttonTextColor; + final addressColor = isSending + ? Colors.white.withOpacity(0.5) + : Theme.of(context).extension()!.buttonSecondaryTextColor; + return Container( height: 70, padding: EdgeInsets.symmetric(vertical: 6, horizontal: 12), @@ -41,6 +45,8 @@ class UnspentCoinsListItem extends StatelessWidget { Padding( padding: EdgeInsets.only(right: 12), child: StandardCheckbox( + iconColor: amountColor, + borderColor: addressColor, value: isSending, onChanged: (value) => onCheckBoxTap?.call())), Expanded( child: Column( diff --git a/lib/src/screens/unspent_coins/widgets/unspent_coins_switch_row.dart b/lib/src/screens/unspent_coins/widgets/unspent_coins_switch_row.dart index 43550a9c5..f62582460 100644 --- a/lib/src/screens/unspent_coins/widgets/unspent_coins_switch_row.dart +++ b/lib/src/screens/unspent_coins/widgets/unspent_coins_switch_row.dart @@ -1,5 +1,6 @@ import 'package:cake_wallet/src/widgets/standard_switch.dart'; import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class UnspentCoinsSwitchRow extends StatelessWidget { UnspentCoinsSwitchRow( @@ -28,10 +29,7 @@ class UnspentCoinsSwitchRow extends StatelessWidget { style: TextStyle( fontSize: titleFontSize, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .labelSmall! - .color!), + color: Theme.of(context).extension()!.detailsTitlesColor), textAlign: TextAlign.left), Padding( padding: EdgeInsets.only(top: 12), diff --git a/lib/src/screens/wallet/wallet_edit_page.dart b/lib/src/screens/wallet/wallet_edit_page.dart index 64575b722..7c90ba2c5 100644 --- a/lib/src/screens/wallet/wallet_edit_page.dart +++ b/lib/src/screens/wallet/wallet_edit_page.dart @@ -102,7 +102,7 @@ class WalletEditPage extends BasePage { } }, text: S.of(context).save, - color: Theme.of(context).accentTextTheme.bodyLarge!.color!, + color: Theme.of(context).primaryColor, textColor: Colors.white, isDisabled: walletEditViewModel.newName.isEmpty || isLoading, ), diff --git a/lib/src/screens/wallet_keys/wallet_keys_page.dart b/lib/src/screens/wallet_keys/wallet_keys_page.dart index 63efdc5f9..37ed3a692 100644 --- a/lib/src/screens/wallet_keys/wallet_keys_page.dart +++ b/lib/src/screens/wallet_keys/wallet_keys_page.dart @@ -13,6 +13,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:qr_flutter/qr_flutter.dart'; +import 'package:cake_wallet/themes/extensions/picker_theme.dart'; class WalletKeysPage extends BasePage { WalletKeysPage(this.walletKeysViewModel); @@ -49,61 +50,68 @@ class WalletKeysPage extends BasePage { @override Widget body(BuildContext context) { return Column( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 24.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12.0), - color: Theme.of(context).accentTextTheme.bodySmall!.color!, - ), - child: Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: AutoSizeText( - S.of(context).do_not_share_warning_text.toUpperCase(), - textAlign: TextAlign.center, - maxLines: 4, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Colors.red)), + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 24.0), + child: Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12.0), + color: Theme.of(context).cardColor, + ), + child: Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: AutoSizeText( + S.of(context).do_not_share_warning_text.toUpperCase(), + textAlign: TextAlign.center, + maxLines: 4, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.red, + ), ), ), ), ), ), - Expanded( - flex: 7, + ), + Expanded( + flex: 7, child: Container( - padding: EdgeInsets.only(top: 20.0, bottom: 20.0), - child: Observer( - builder: (_) { - return ListView.separated( - separatorBuilder: (context, index) => Container( - height: 1, - padding: EdgeInsets.only(left: 24), - color: Theme.of(context).accentTextTheme.titleLarge!.backgroundColor!, - child: const SectionDivider(), - ), - itemCount: walletKeysViewModel.items.length, - itemBuilder: (BuildContext context, int index) { - final item = walletKeysViewModel.items[index]; + padding: EdgeInsets.only(top: 20.0, bottom: 20.0), + child: Observer( + builder: (_) { + return ListView.separated( + separatorBuilder: (context, index) => Container( + height: 1, + padding: EdgeInsets.only(left: 24), + color: Theme.of(context).extension()!.dividerColor, + child: const HorizontalSectionDivider(), + ), + itemCount: walletKeysViewModel.items.length, + itemBuilder: (BuildContext context, int index) { + final item = walletKeysViewModel.items[index]; - return GestureDetector( - onTap: () { - ClipboardUtil.setSensitiveDataToClipboard(ClipboardData(text: item.value)); - showBar(context, S.of(context).copied_key_to_clipboard(item.title)); - }, - child: ListRow( - title: item.title + ':', - value: item.value, - ), - ); - }); - }, - )))]); + return GestureDetector( + onTap: () { + ClipboardUtil.setSensitiveDataToClipboard(ClipboardData(text: item.value)); + showBar(context, S.of(context).copied_key_to_clipboard(item.title)); + }, + child: ListRow( + title: item.title + ':', + value: item.value, + ), + ); + }, + ); + }, + ), + ), + ), + ], + ); } } diff --git a/lib/src/screens/wallet_list/wallet_list_page.dart b/lib/src/screens/wallet_list/wallet_list_page.dart index 81086fac9..2fcc491f0 100644 --- a/lib/src/screens/wallet_list/wallet_list_page.dart +++ b/lib/src/screens/wallet_list/wallet_list_page.dart @@ -1,5 +1,7 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/core/auth_service.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cake_wallet/utils/show_bar.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; @@ -15,6 +17,7 @@ import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/wallet_type_utils.dart'; +import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; class WalletListPage extends BasePage { WalletListPage({required this.walletListViewModel, required this.authService}); @@ -56,7 +59,9 @@ class WalletListBodyState extends State { final newWalletImage = Image.asset('assets/images/new_wallet.png', height: 12, width: 12, color: Colors.white); final restoreWalletImage = Image.asset('assets/images/restore_wallet.png', - height: 12, width: 12, color: Theme.of(context).primaryTextTheme.titleLarge!.color!); + height: 12, + width: 12, + color: Theme.of(context).extension()!.buttonTextColor); return Container( padding: EdgeInsets.only(top: 16), @@ -73,7 +78,9 @@ class WalletListBodyState extends State { itemBuilder: (__, index) { final wallet = widget.walletListViewModel.wallets[index]; final currentColor = wallet.isCurrent - ? Theme.of(context).accentTextTheme.titleSmall!.decorationColor! + ? Theme.of(context) + .extension()! + .createNewWalletButtonBackgroundColor : Theme.of(context).colorScheme.background; final row = GestureDetector( onTap: () => wallet.isCurrent ? null : _loadWallet(wallet), @@ -98,29 +105,25 @@ class WalletListBodyState extends State { color: Theme.of(context).colorScheme.background, alignment: Alignment.centerLeft, child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - wallet.isEnabled - ? _imageFor(type: wallet.type) - : nonWalletTypeIcon, - SizedBox(width: 10), - Flexible( - child: Text( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + wallet.isEnabled + ? _imageFor(type: wallet.type) + : nonWalletTypeIcon, + SizedBox(width: 10), + Flexible( + child: Text( wallet.name, maxLines: null, softWrap: true, style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme - .titleLarge! - .color!, - ), - ), - ), - ], - ), + fontSize: 22, + fontWeight: FontWeight.w500, + color: Theme.of(context) + .extension()! + .titleColor), + )) + ]), ), ), ], @@ -144,13 +147,14 @@ class WalletListBodyState extends State { decoration: BoxDecoration( shape: BoxShape.circle, color: Theme.of(context) - .textTheme - .headlineMedium! - .decorationColor!), + .extension()! + .iconsBackgroundColor), child: Icon( Icons.edit, size: 14, - color: Theme.of(context).textTheme.headlineMedium!.color!, + color: Theme.of(context) + .extension()! + .iconsColor, ), ), ), diff --git a/lib/src/screens/welcome/welcome_page.dart b/lib/src/screens/welcome/welcome_page.dart index 35537f063..19d63f2e7 100644 --- a/lib/src/screens/welcome/welcome_page.dart +++ b/lib/src/screens/welcome/welcome_page.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:flutter/material.dart'; @@ -6,6 +7,8 @@ import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/wallet_type_utils.dart'; +import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; +import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; class WelcomePage extends BasePage { static const aspectRatioImage = 1.25; @@ -53,15 +56,12 @@ class WelcomePage extends BasePage { final newWalletImage = Image.asset('assets/images/new_wallet.png', height: 12, width: 12, - color: Theme.of(context) - .accentTextTheme.headlineSmall! - .decorationColor!); + color: Theme.of(context).extension()!.restoreWalletButtonTextColor); final restoreWalletImage = Image.asset('assets/images/restore_wallet.png', height: 12, width: 12, - - color: Theme.of(context).primaryTextTheme.titleLarge!.color!); + color: Theme.of(context).extension()!.titleColor); return WillPopScope( onWillPop: () async => false, @@ -88,9 +88,7 @@ class WelcomePage extends BasePage { style: TextStyle( fontSize: 18, fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme.displayMedium! - .color!, + color: Theme.of(context).extension()!.hintTextColor, ), textAlign: TextAlign.center, ), @@ -102,9 +100,7 @@ class WelcomePage extends BasePage { style: TextStyle( fontSize: 36, fontWeight: FontWeight.bold, - color: Theme.of(context) - .primaryTextTheme.titleLarge! - .color!, + color: Theme.of(context).extension()!.titleColor, ), textAlign: TextAlign.center, ), @@ -116,9 +112,7 @@ class WelcomePage extends BasePage { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme.displayMedium! - .color!, + color: Theme.of(context).extension()!.hintTextColor, ), textAlign: TextAlign.center, ), @@ -132,9 +126,7 @@ class WelcomePage extends BasePage { style: TextStyle( fontSize: 12, fontWeight: FontWeight.normal, - color: Theme.of(context) - .accentTextTheme.displayMedium! - .color!, + color: Theme.of(context).extension()!.hintTextColor, ), textAlign: TextAlign.center, ), @@ -145,12 +137,8 @@ class WelcomePage extends BasePage { context, Routes.newWalletFromWelcome), image: newWalletImage, text: S.of(context).create_new, - color: Theme.of(context) - .accentTextTheme.titleSmall! - .decorationColor!, - textColor: Theme.of(context) - .accentTextTheme.headlineSmall! - .decorationColor!, + color: Theme.of(context).extension()!.createNewWalletButtonBackgroundColor, + textColor: Theme.of(context).extension()!.restoreWalletButtonTextColor, ), ), Padding( @@ -163,12 +151,8 @@ class WelcomePage extends BasePage { }, image: restoreWalletImage, text: S.of(context).restore_wallet, - color: Theme.of(context) - .accentTextTheme.bodySmall! - .color!, - textColor: Theme.of(context) - .primaryTextTheme.titleLarge! - .color!), + color: Theme.of(context).cardColor, + textColor: Theme.of(context).extension()!.titleColor), ) ], ) diff --git a/lib/src/screens/yat_emoji_id.dart b/lib/src/screens/yat_emoji_id.dart index 6e3ec9cb1..944331285 100644 --- a/lib/src/screens/yat_emoji_id.dart +++ b/lib/src/screens/yat_emoji_id.dart @@ -6,12 +6,15 @@ import 'package:cake_wallet/src/screens/yat/widgets/yat_close_button.dart'; import 'package:cake_wallet/src/widgets/alert_background.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/store/yat/yat_store.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:flutter/material.dart'; import 'package:animate_do/animate_do.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:url_launcher/url_launcher.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'; class YatEmojiId extends StatelessWidget { YatEmojiId(this.emojiId); @@ -39,7 +42,7 @@ class YatEmojiId extends StatelessWidget { child: Container( height: 420, color: - Theme.of(context).textTheme!.titleLarge!.backgroundColor!, + Theme.of(context).extension()!.syncedBackgroundColor, padding: EdgeInsets.fromLTRB(24, 15, 24, 24), child: Column( mainAxisSize: MainAxisSize.max, @@ -89,7 +92,7 @@ class YatEmojiId extends StatelessWidget { fontSize: 32, fontWeight: FontWeight.bold, fontFamily: 'Lato', - color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!, + color: Theme.of(context).extension()!.textColor, decoration: TextDecoration.none, ) ), @@ -102,10 +105,7 @@ class YatEmojiId extends StatelessWidget { fontSize: 18, fontWeight: FontWeight.normal, fontFamily: 'Lato', - color: Theme.of(context) - .accentTextTheme! - .displaySmall! - .backgroundColor!, + color: Theme.of(context).extension()!.labelTextColor, decoration: TextDecoration.none, ) ) diff --git a/lib/src/widgets/add_template_button.dart b/lib/src/widgets/add_template_button.dart index c88b72e7f..667a103ab 100644 --- a/lib/src/widgets/add_template_button.dart +++ b/lib/src/widgets/add_template_button.dart @@ -2,6 +2,7 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:dotted_border/dotted_border.dart'; import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class AddTemplateButton extends StatelessWidget { final Function() onTap; @@ -20,7 +21,7 @@ class AddTemplateButton extends StatelessWidget { borderType: BorderType.RRect, dashPattern: [6, 4], color: - Theme.of(context).primaryTextTheme!.displaySmall!.decorationColor!, + Theme.of(context).extension()!.templateDottedBorderColor, strokeWidth: 2, radius: Radius.circular(20), child: Container( @@ -35,20 +36,14 @@ class AddTemplateButton extends StatelessWidget { child: currentTemplatesLength >= 1 ? Icon( Icons.add, - color: Theme.of(context) - .primaryTextTheme! - .displayMedium! - .color!, + color: Theme.of(context).extension()!.templateNewTextColor, ) : Text( S.of(context).new_template, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, - color: Theme.of(context) - .primaryTextTheme! - .displayMedium! - .color!, + color: Theme.of(context).extension()!.templateNewTextColor, ), ), ), diff --git a/lib/src/widgets/address_text_field.dart b/lib/src/widgets/address_text_field.dart index 3462c7ed4..000e6325e 100644 --- a/lib/src/widgets/address_text_field.dart +++ b/lib/src/widgets/address_text_field.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/utils/device_info.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:flutter/services.dart'; @@ -7,6 +8,7 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/entities/qr_scanner.dart'; import 'package:cake_wallet/entities/contact_base.dart'; import 'package:cw_core/crypto_currency.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; enum AddressTextFieldOption { paste, qrCode, addressBook } @@ -64,7 +66,8 @@ class AddressTextField extends StatelessWidget { controller: controller, focusNode: focusNode, style: textStyle ?? - TextStyle(fontSize: 16, color: Theme.of(context).primaryTextTheme.titleLarge!.color!), + TextStyle( + fontSize: 16, color: Theme.of(context).extension()!.titleColor), decoration: InputDecoration( suffixIcon: SizedBox( width: prefixIconWidth * options.length + (spaceBetweenPrefixIcons * options.length), @@ -113,15 +116,14 @@ class AddressTextField extends StatelessWidget { padding: EdgeInsets.all(8), decoration: BoxDecoration( color: buttonColor ?? - Theme.of(context).accentTextTheme.titleLarge!.color!, + Theme.of(context).dialogTheme.backgroundColor, borderRadius: BorderRadius.all(Radius.circular(6))), child: Image.asset( 'assets/images/paste_ios.png', color: iconColor ?? Theme.of(context) - .primaryTextTheme - .headlineMedium! - .decorationColor!, + .extension()! + .textFieldButtonIconColor, )), ), )), @@ -140,15 +142,14 @@ class AddressTextField extends StatelessWidget { padding: EdgeInsets.all(8), decoration: BoxDecoration( color: buttonColor ?? - Theme.of(context).accentTextTheme.titleLarge!.color!, + Theme.of(context).dialogTheme.backgroundColor, borderRadius: BorderRadius.all(Radius.circular(6))), child: Image.asset( 'assets/images/qr_code_icon.png', color: iconColor ?? Theme.of(context) - .primaryTextTheme - .headlineMedium! - .decorationColor!, + .extension()! + .textFieldButtonIconColor, )), ), )) @@ -167,15 +168,14 @@ class AddressTextField extends StatelessWidget { padding: EdgeInsets.all(8), decoration: BoxDecoration( color: buttonColor ?? - Theme.of(context).accentTextTheme.titleLarge!.color!, + Theme.of(context).dialogTheme.backgroundColor, borderRadius: BorderRadius.all(Radius.circular(6))), child: Image.asset( 'assets/images/open_book.png', color: iconColor ?? Theme.of(context) - .primaryTextTheme - .headlineMedium! - .decorationColor!, + .extension()! + .textFieldButtonIconColor, )), ), )) diff --git a/lib/src/widgets/alert_background.dart b/lib/src/widgets/alert_background.dart index 1b72597af..0ced8ee06 100644 --- a/lib/src/widgets/alert_background.dart +++ b/lib/src/widgets/alert_background.dart @@ -1,7 +1,7 @@ import 'dart:ui'; +import 'package:cake_wallet/themes/extensions/alert_theme.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; class AlertBackground extends StatelessWidget { AlertBackground({required this.child}); @@ -20,7 +20,9 @@ class AlertBackground extends StatelessWidget { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), child: Container( - decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)), + decoration: BoxDecoration( + color: + Theme.of(context).extension()!.backdropColor), child: Center( child: Container( width: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint, diff --git a/lib/src/widgets/alert_with_one_action.dart b/lib/src/widgets/alert_with_one_action.dart index c3b364e8d..c06114f5b 100644 --- a/lib/src/widgets/alert_with_one_action.dart +++ b/lib/src/widgets/alert_with_one_action.dart @@ -31,10 +31,7 @@ class AlertWithOneAction extends BaseAlertDialog { width: 300, height: 52, padding: EdgeInsets.only(left: 12, right: 12), - color: Theme.of(context) - .accentTextTheme! - .bodyMedium! - .backgroundColor!, + color: Theme.of(context).dialogBackgroundColor, child: ButtonTheme( minWidth: double.infinity, child: TextButton( @@ -48,10 +45,7 @@ class AlertWithOneAction extends BaseAlertDialog { style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600, - color: Theme.of(context) - .primaryTextTheme! - .bodyMedium! - .backgroundColor!, + color: Theme.of(context).primaryColor, decoration: TextDecoration.none, ), )), diff --git a/lib/src/widgets/base_alert_dialog.dart b/lib/src/widgets/base_alert_dialog.dart index 995e3f205..757ee1862 100644 --- a/lib/src/widgets/base_alert_dialog.dart +++ b/lib/src/widgets/base_alert_dialog.dart @@ -1,5 +1,7 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'dart:ui'; import 'package:cake_wallet/src/widgets/section_divider.dart'; +import 'package:cake_wallet/themes/extensions/alert_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/palette.dart'; @@ -25,7 +27,7 @@ class BaseAlertDialog extends StatelessWidget { fontSize: 20, fontFamily: 'Lato', fontWeight: FontWeight.w600, - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ); @@ -39,7 +41,7 @@ class BaseAlertDialog extends StatelessWidget { fontSize: 16, fontWeight: FontWeight.normal, fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme!.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ); @@ -57,10 +59,7 @@ class BaseAlertDialog extends StatelessWidget { onPressed: actionLeft, style: TextButton.styleFrom( backgroundColor: leftActionButtonColor ?? - Theme.of(context) - .accentTextTheme! - .bodyLarge! - .decorationColor!, + Theme.of(context).dialogBackgroundColor, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.zero))), child: Text( @@ -71,24 +70,18 @@ class BaseAlertDialog extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.w600, color: leftActionButtonTextColor ?? - Theme.of(context) - .primaryTextTheme! - .bodyLarge! - .backgroundColor!, + Theme.of(context).extension()!.leftButtonTextColor, decoration: TextDecoration.none, ), )), ), - const SectionDivider(), + const VerticalSectionDivider(), Expanded( child: TextButton( onPressed: actionRight, style: TextButton.styleFrom( backgroundColor: rightActionButtonColor ?? - Theme.of(context) - .accentTextTheme! - .bodyMedium! - .backgroundColor!, + Theme.of(context).dialogBackgroundColor, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.zero))), child: Text( @@ -99,10 +92,7 @@ class BaseAlertDialog extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.w600, color: rightActionButtonTextColor ?? - Theme.of(context) - .primaryTextTheme! - .bodyMedium! - .backgroundColor!, + Theme.of(context).primaryColor, decoration: TextDecoration.none, ), )), @@ -120,7 +110,9 @@ class BaseAlertDialog extends StatelessWidget { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), child: Container( - decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)), + decoration: BoxDecoration( + color: + Theme.of(context).extension()!.backdropColor), child: Center( child: GestureDetector( onTap: () => null, @@ -128,10 +120,7 @@ class BaseAlertDialog extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(30)), child: Container( width: 300, - color: Theme.of(context) - .accentTextTheme! - .titleLarge! - .decorationColor!, + color: Theme.of(context).dialogBackgroundColor, child: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -145,7 +134,7 @@ class BaseAlertDialog extends StatelessWidget { isDividerExists ? Padding( padding: EdgeInsets.only(top: 16, bottom: 8), - child: const SectionDivider(), + child: const HorizontalSectionDivider(), ) : Offstage(), Padding( @@ -154,7 +143,7 @@ class BaseAlertDialog extends StatelessWidget { ) ], ), - const SectionDivider(), + const HorizontalSectionDivider(), actionButtons(context) ], ), diff --git a/lib/src/widgets/base_text_form_field.dart b/lib/src/widgets/base_text_form_field.dart index a9dd51380..5649a0784 100644 --- a/lib/src/widgets/base_text_form_field.dart +++ b/lib/src/widgets/base_text_form_field.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -78,7 +79,7 @@ class BaseTextFormField extends StatelessWidget { TextStyle( fontSize: 16.0, color: textColor ?? - Theme.of(context).primaryTextTheme!.titleLarge!.color!), + Theme.of(context).extension()!.titleColor), decoration: InputDecoration( prefix: prefix, prefixIcon: prefixIcon, @@ -92,26 +93,17 @@ class BaseTextFormField extends StatelessWidget { focusedBorder: UnderlineInputBorder( borderSide: BorderSide( color: borderColor ?? - Theme.of(context) - .primaryTextTheme! - .titleLarge! - .backgroundColor!, + Theme.of(context).extension()!.textfieldUnderlineColor, width: borderWidth)), disabledBorder: UnderlineInputBorder( borderSide: BorderSide( color: borderColor ?? - Theme.of(context) - .primaryTextTheme! - .titleLarge! - .backgroundColor!, + Theme.of(context).extension()!.textfieldUnderlineColor, width: borderWidth)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( color: borderColor ?? - Theme.of(context) - .primaryTextTheme! - .titleLarge! - .backgroundColor!, + Theme.of(context).extension()!.textfieldUnderlineColor, width: borderWidth))), validator: validator, ); diff --git a/lib/src/widgets/blockchain_height_widget.dart b/lib/src/widgets/blockchain_height_widget.dart index 6d2b891db..2ba0a3406 100644 --- a/lib/src/widgets/blockchain_height_widget.dart +++ b/lib/src/widgets/blockchain_height_widget.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/utils/date_picker.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; @@ -81,7 +82,7 @@ class BlockchainHeightState extends State { fontSize: 16.0, fontWeight: FontWeight.w500, color: - Theme.of(context).primaryTextTheme!.titleLarge!.color!), + Theme.of(context).extension()!.titleColor), ), ), Row( diff --git a/lib/src/widgets/cake_scrollbar.dart b/lib/src/widgets/cake_scrollbar.dart index 6b8cb59da..bf6604d8e 100644 --- a/lib/src/widgets/cake_scrollbar.dart +++ b/lib/src/widgets/cake_scrollbar.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart'; import 'package:flutter/material.dart'; class CakeScrollbar extends StatelessWidget { @@ -28,7 +29,7 @@ class CakeScrollbar extends StatelessWidget { width: width, decoration: BoxDecoration( color: backgroundColor ?? - Theme.of(context).textTheme!.bodyMedium!.decorationColor!, + Theme.of(context).extension()!.trackColor, borderRadius: BorderRadius.all(Radius.circular(3))), child: Stack( children: [ @@ -40,7 +41,7 @@ class CakeScrollbar extends StatelessWidget { width: width, decoration: BoxDecoration( color: thumbColor ?? - Theme.of(context).textTheme!.bodyMedium!.color!, + Theme.of(context).extension()!.thumbColor, borderRadius: BorderRadius.all(Radius.circular(3))), ), ) diff --git a/lib/src/widgets/check_box_picker.dart b/lib/src/widgets/check_box_picker.dart index 7fd0b57a3..30f81e981 100644 --- a/lib/src/widgets/check_box_picker.dart +++ b/lib/src/widgets/check_box_picker.dart @@ -1,7 +1,10 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/src/widgets/picker_wrapper_widget.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; +import 'package:cake_wallet/themes/extensions/picker_theme.dart'; class CheckBoxPicker extends StatefulWidget { CheckBoxPicker({ @@ -53,10 +56,7 @@ class CheckBoxPickerState extends State { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(30)), child: Container( - color: Theme.of(context) - .accentTextTheme! - .titleLarge! - .color!, + color: Theme.of(context).dialogTheme.backgroundColor, child: ConstrainedBox( constraints: BoxConstraints( maxHeight: MediaQuery.of(context).size.height * 0.65, @@ -90,20 +90,14 @@ class CheckBoxPickerState extends State { Widget itemsList() { return Container( - color: Theme.of(context) - .accentTextTheme! - .titleLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.dividerColor, child: ListView.separated( padding: EdgeInsets.zero, controller: controller, shrinkWrap: true, separatorBuilder: (context, index) => widget.isSeparated ? Divider( - color: Theme.of(context) - .accentTextTheme! - .titleLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.dividerColor, height: 1, ) : const SizedBox(), @@ -122,19 +116,13 @@ class CheckBoxPickerState extends State { }, child: Container( height: 55, - color: Theme.of(context) - .accentTextTheme! - .titleLarge! - .color!, + color: Theme.of(context).dialogTheme.backgroundColor, padding: EdgeInsets.only(left: 24, right: 24), child: CheckboxListTile( value: item.value, activeColor: item.value ? Palette.blueCraiola - : Theme.of(context) - .accentTextTheme! - .titleMedium! - .decorationColor!, + : Theme.of(context).extension()!.checkboxBackgroundColor, checkColor: Colors.white, title: widget.displayItem?.call(item) ?? Text( @@ -145,7 +133,7 @@ class CheckBoxPickerState extends State { fontWeight: FontWeight.w600, color: item.isDisabled ? Colors.grey.withOpacity(0.5) - : Theme.of(context).primaryTextTheme!.titleLarge!.color!, + : Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ), diff --git a/lib/src/widgets/checkbox_widget.dart b/lib/src/widgets/checkbox_widget.dart index 20c900b25..1ea3ee698 100644 --- a/lib/src/widgets/checkbox_widget.dart +++ b/lib/src/widgets/checkbox_widget.dart @@ -1,5 +1,7 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/palette.dart'; import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; class CheckboxWidget extends StatefulWidget { CheckboxWidget({required this.value, required this.caption, required this.onChanged}); @@ -37,7 +39,9 @@ class CheckboxWidgetState extends State { margin: EdgeInsets.only(right: 10.0), decoration: BoxDecoration( border: Border.all( - color: Theme.of(context).primaryTextTheme.bodySmall!.color!, + color: value + ? Palette.blueCraiola + : Theme.of(context).extension()!.checkboxBoundsColor, width: 1.0, ), borderRadius: BorderRadius.all( @@ -59,12 +63,12 @@ class CheckboxWidgetState extends State { style: TextStyle( fontWeight: FontWeight.bold, fontSize: 14.0, - color: Theme.of(context).primaryTextTheme.titleLarge!.color!, + color: Theme.of(context).extension()!.titleColor, ), ), ) ], - ), + ) ); } } diff --git a/lib/src/widgets/collapsible_standart_list.dart b/lib/src/widgets/collapsible_standart_list.dart index 1fef64969..83e4daee2 100644 --- a/lib/src/widgets/collapsible_standart_list.dart +++ b/lib/src/widgets/collapsible_standart_list.dart @@ -3,90 +3,36 @@ import 'package:flutter/material.dart'; class CollapsibleSectionList extends SectionStandardList { CollapsibleSectionList( - {required BuildContext context, - required int sectionCount, - required int Function(int sectionIndex) itemCounter, - required Widget Function(BuildContext context, int sectionIndex, int itemIndex) itemBuilder, - Color? themeColor, - Color? dividerThemeColor, - Widget Function(BuildContext context, int sectionIndex)? sectionTitleBuilder, - bool hasTopSeparator = false}) + {required int sectionCount, + required int Function(int sectionIndex) itemCounter, + required Widget Function(int sectionIndex, int itemIndex) itemBuilder, + Widget Function(int sectionIndex)? sectionTitleBuilder, + bool hasTopSeparator = false}) : super( - context: context, - hasTopSeparator: hasTopSeparator, - sectionCount: sectionCount, - itemCounter: itemCounter, - itemBuilder: itemBuilder, - sectionTitleBuilder: sectionTitleBuilder, - themeColor: themeColor, - dividerThemeColor: dividerThemeColor); + hasTopSeparator: hasTopSeparator, + sectionCount: sectionCount, + itemCounter: itemCounter, + itemBuilder: itemBuilder, + sectionTitleBuilder: sectionTitleBuilder); @override - List transform( - bool hasTopSeparator, - BuildContext context, - int sectionCount, - int Function(int sectionIndex) itemCounter, - Widget Function(BuildContext context, int sectionIndex, int itemIndex) itemBuilder, - Widget Function(BuildContext context, int sectionIndex)? sectionTitleBuilder, - Color? themeColor, - Color? dividerThemeColor) { - final items = []; - - for (var sectionIndex = 0; sectionIndex < sectionCount; sectionIndex++) { - final itemCount = itemCounter(sectionIndex); - - items.add(Theme( - data: ThemeData( - textTheme: TextTheme(titleMedium: TextStyle(color: themeColor,fontFamily: 'Lato')), - backgroundColor: dividerThemeColor, - unselectedWidgetColor: themeColor, - accentColor: themeColor) - .copyWith(dividerColor: Colors.transparent), - child: Padding( - padding: const EdgeInsets.only(left: 24.0), - child: ListTileTheme( - contentPadding: EdgeInsets.only(right: 16,top:sectionIndex>0?26:0), - child: ExpansionTile( - textColor: themeColor, - iconColor: themeColor, - title: sectionTitleBuilder == null - ? Container() - : Container(child: buildTitle(items, sectionIndex, context)), - initiallyExpanded: true, - children: buildSection(itemCount, items, sectionIndex, context), - ), - ), - ), - )); - - } - - items.add(StandardListSeparator(padding: EdgeInsets.only(left: 24))); - return items; - } - - @override - Widget buildTitle( - List items, int sectionIndex, BuildContext context) { + Widget buildTitle(List items, int sectionIndex) { if (sectionTitleBuilder == null) { throw Exception('Cannot to build title. sectionTitleBuilder is null'); } - return sectionTitleBuilder!.call(context, sectionIndex); + return sectionTitleBuilder!.call(sectionIndex); } @override - List buildSection(int itemCount, List items, int sectionIndex, - BuildContext context) { + List buildSection(int itemCount, List items, int sectionIndex) { final List section = []; for (var itemIndex = 0; itemIndex < itemCount; itemIndex++) { - final item = itemBuilder(context, sectionIndex, itemIndex); + final item = itemBuilder(sectionIndex, itemIndex); section.add(StandardListSeparator()); section.add(item); - } return section; } diff --git a/lib/src/widgets/dashboard_card_widget.dart b/lib/src/widgets/dashboard_card_widget.dart index f98e5d68e..b3f92123a 100644 --- a/lib/src/widgets/dashboard_card_widget.dart +++ b/lib/src/widgets/dashboard_card_widget.dart @@ -1,4 +1,7 @@ +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; class DashBoardRoundedCardWidget extends StatelessWidget { @@ -26,10 +29,10 @@ class DashBoardRoundedCardWidget extends StatelessWidget { padding: EdgeInsets.all(20), width: double.infinity, decoration: BoxDecoration( - color: Theme.of(context).textTheme!.titleLarge!.backgroundColor!, + color: Theme.of(context).extension()!.syncedBackgroundColor, borderRadius: BorderRadius.circular(20), border: Border.all( - color: Colors.white.withOpacity(0.20), + color: Theme.of(context).extension()!.cardBorderColor, ), ), child: @@ -39,10 +42,7 @@ class DashBoardRoundedCardWidget extends StatelessWidget { Text( title, style: TextStyle( - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.cardTextColor, fontSize: 24, fontWeight: FontWeight.w900, ), @@ -51,10 +51,7 @@ class DashBoardRoundedCardWidget extends StatelessWidget { Text( subTitle, style: TextStyle( - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.cardTextColor, fontWeight: FontWeight.w500, fontFamily: 'Lato'), ) diff --git a/lib/src/widgets/gradient_background.dart b/lib/src/widgets/gradient_background.dart new file mode 100644 index 000000000..591e24289 --- /dev/null +++ b/lib/src/widgets/gradient_background.dart @@ -0,0 +1,30 @@ +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:flutter/material.dart'; + +class GradientBackground extends StatelessWidget { + const GradientBackground({required this.scaffold}); + + final Widget scaffold; + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + Theme.of(context) + .extension()! + .firstGradientBackgroundColor, + Theme.of(context) + .extension()! + .secondGradientBackgroundColor, + Theme.of(context) + .extension()! + .thirdGradientBackgroundColor, + ], + begin: Alignment.topRight, + end: Alignment.bottomLeft, + )), + child: scaffold); + } +} diff --git a/lib/src/widgets/introducing_card.dart b/lib/src/widgets/introducing_card.dart index 0a4a27f36..bd71183fd 100644 --- a/lib/src/widgets/introducing_card.dart +++ b/lib/src/widgets/introducing_card.dart @@ -1,6 +1,8 @@ import 'package:auto_size_text/auto_size_text.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; import 'package:cake_wallet/generated/i18n.dart'; class IntroducingCard extends StatelessWidget { @@ -27,7 +29,7 @@ class IntroducingCard extends StatelessWidget { color: borderColor, width: 1, ), - color: Theme.of(context).textTheme!.titleLarge!.backgroundColor!), + color: Theme.of(context).extension()!.syncedBackgroundColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, @@ -45,10 +47,7 @@ class IntroducingCard extends StatelessWidget { fontSize: 24, fontFamily: 'Lato', fontWeight: FontWeight.bold, - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.cardTextColor, height: 1), maxLines: 1, textAlign: TextAlign.center), @@ -58,10 +57,7 @@ class IntroducingCard extends StatelessWidget { style: TextStyle( fontSize: 12, fontFamily: 'Lato', - color: Theme.of(context) - .accentTextTheme! - .displayMedium! - .backgroundColor!, + color: Theme.of(context).extension()!.cardTextColor, height: 1)), ], ), diff --git a/lib/src/widgets/list_row.dart b/lib/src/widgets/list_row.dart index d9d9e2f8d..c404a443b 100644 --- a/lib/src/widgets/list_row.dart +++ b/lib/src/widgets/list_row.dart @@ -1,5 +1,7 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class ListRow extends StatelessWidget { ListRow( @@ -30,10 +32,7 @@ class ListRow extends StatelessWidget { style: TextStyle( fontSize: titleFontSize, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .labelSmall! - .color!), + color: Theme.of(context).extension()!.detailsTitlesColor), textAlign: TextAlign.left), Padding( padding: const EdgeInsets.only(top: 12), @@ -47,10 +46,7 @@ class ListRow extends StatelessWidget { style: TextStyle( fontSize: valueFontSize, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!)), + color: Theme.of(context).extension()!.titleColor)), ), image != null ? Padding( diff --git a/lib/src/widgets/picker.dart b/lib/src/widgets/picker.dart index c9d3be757..6b6543d2f 100644 --- a/lib/src/widgets/picker.dart +++ b/lib/src/widgets/picker.dart @@ -7,6 +7,9 @@ import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:flutter/material.dart'; import 'package:cw_core/currency.dart'; import 'package:cake_wallet/src/widgets/picker_wrapper_widget.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart'; +import 'package:cake_wallet/themes/extensions/picker_theme.dart'; class Picker extends StatefulWidget { Picker({ @@ -40,8 +43,7 @@ class Picker extends StatefulWidget { final bool Function(Item, String)? matchingCriteria; @override - _PickerState createState() => - _PickerState(items, images, onItemSelected); + _PickerState createState() => _PickerState(items, images, onItemSelected); } class _PickerState extends State> { @@ -90,8 +92,7 @@ class _PickerState extends State> { setState(() { filteredItems = List.from(items.where((element) { if (widget.selectedAtIndex != items.indexOf(element) && - (widget.matchingCriteria?.call(element, searchController.text) ?? - true)) { + (widget.matchingCriteria?.call(element, searchController.text) ?? true)) { if (images.isNotEmpty) { filteredImages.add(images[items.indexOf(element)]); } @@ -146,9 +147,7 @@ class _PickerState extends State> { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(30)), child: Container( - color: Theme.of(context) - .accentTextTheme.titleLarge! - .color!, + color: Theme.of(context).dialogTheme.backgroundColor, child: ConstrainedBox( constraints: BoxConstraints( maxHeight: containerHeight, @@ -163,13 +162,10 @@ class _PickerState extends State> { child: SearchBarWidget(searchController: searchController), ), Divider( - color: Theme.of(context) - .accentTextTheme.titleLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.dividerColor, height: 1, ), - if (widget.selectedAtIndex != -1) - buildSelectedItem(widget.selectedAtIndex), + if (widget.selectedAtIndex != -1) buildSelectedItem(widget.selectedAtIndex), Flexible( child: Stack( alignment: Alignment.center, @@ -193,9 +189,8 @@ class _PickerState extends State> { fontWeight: FontWeight.w500, fontFamily: 'Lato', decoration: TextDecoration.none, - color: Theme.of(context) - .primaryTextTheme.titleLarge! - .color!, + color: + Theme.of(context).extension()!.titleColor, ), ), ) @@ -215,9 +210,7 @@ class _PickerState extends State> { Widget itemsList() { return Container( - color: Theme.of(context) - .accentTextTheme.titleLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.dividerColor, child: widget.isGridView ? GridView.builder( padding: EdgeInsets.zero, @@ -237,9 +230,7 @@ class _PickerState extends State> { shrinkWrap: true, separatorBuilder: (context, index) => widget.isSeparated ? Divider( - color: Theme.of(context) - .accentTextTheme.titleLarge! - .backgroundColor!, + color: Theme.of(context).extension()!.dividerColor, height: 1, ) : const SizedBox(), @@ -264,9 +255,7 @@ class _PickerState extends State> { }, child: Container( height: 55, - color: Theme.of(context) - .accentTextTheme.titleLarge! - .color!, + color: Theme.of(context).dialogTheme.backgroundColor, padding: EdgeInsets.symmetric(horizontal: 24), child: Row( mainAxisSize: MainAxisSize.max, @@ -287,9 +276,7 @@ class _PickerState extends State> { fontSize: 14, fontFamily: 'Lato', fontWeight: FontWeight.w600, - color: Theme.of(context) - .primaryTextTheme.titleLarge! - .color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ), @@ -304,19 +291,17 @@ class _PickerState extends State> { child: Text( tag, style: TextStyle( - fontSize: 7.0, - fontFamily: 'Lato', - color: Theme.of(context) - .textTheme.bodyMedium! - .color!), + fontSize: 7.0, + fontFamily: 'Lato', + color: + Theme.of(context).extension()!.thumbColor, + ), ), ), decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), //border: Border.all(color: ), - color: Theme.of(context) - .textTheme.bodyMedium! - .decorationColor!, + color: Theme.of(context).extension()!.trackColor, ), ), ), @@ -344,9 +329,7 @@ class _PickerState extends State> { }, child: Container( height: 55, - color: Theme.of(context) - .accentTextTheme.titleLarge! - .color!, + color: Theme.of(context).dialogTheme.backgroundColor, padding: EdgeInsets.symmetric(horizontal: 24), child: Row( mainAxisSize: MainAxisSize.max, @@ -367,9 +350,7 @@ class _PickerState extends State> { fontSize: 16, fontFamily: 'Lato', fontWeight: FontWeight.w700, - color: Theme.of(context) - .primaryTextTheme.titleLarge! - .color!, + color: Theme.of(context).extension()!.titleColor, decoration: TextDecoration.none, ), ), @@ -384,19 +365,17 @@ class _PickerState extends State> { child: Text( tag, style: TextStyle( - fontSize: 7.0, - fontFamily: 'Lato', - color: Theme.of(context) - .textTheme.bodyMedium! - .color!), + fontSize: 7.0, + fontFamily: 'Lato', + color: + Theme.of(context).extension()!.thumbColor, + ), ), ), decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), //border: Border.all(color: ), - color: Theme.of(context) - .textTheme.bodyMedium! - .decorationColor!, + color: Theme.of(context).extension()!.trackColor, ), ), ), @@ -404,10 +383,7 @@ class _PickerState extends State> { ), ), ), - Icon(Icons.check_circle, - color: Theme.of(context) - .accentTextTheme.bodyLarge! - .color!), + Icon(Icons.check_circle, color: Theme.of(context).primaryColor), ], ), ), diff --git a/lib/src/widgets/picker_inner_wrapper_widget.dart b/lib/src/widgets/picker_inner_wrapper_widget.dart index d91789b2a..3d9a289bc 100644 --- a/lib/src/widgets/picker_inner_wrapper_widget.dart +++ b/lib/src/widgets/picker_inner_wrapper_widget.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/account_list_theme.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/src/widgets/picker_wrapper_widget.dart'; @@ -44,7 +45,7 @@ class PickerInnerWrapperWidget extends StatelessWidget { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(14)), child: Container( - color: Theme.of(context).textTheme.displayLarge!.decorationColor!, + color: Theme.of(context).dialogTheme.backgroundColor, child: ConstrainedBox( constraints: BoxConstraints( maxHeight: @@ -72,7 +73,7 @@ class PickerInnerWrapperWidget extends StatelessWidget { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(14)), child: Container( - color: Theme.of(context).textTheme.displayLarge!.decorationColor!, + color: Theme.of(context).dialogTheme.backgroundColor, child: ConstrainedBox( constraints: BoxConstraints( maxHeight: containerHeight, diff --git a/lib/src/widgets/search_bar_widget.dart b/lib/src/widgets/search_bar_widget.dart index 04d687cf6..bdb520d55 100644 --- a/lib/src/widgets/search_bar_widget.dart +++ b/lib/src/widgets/search_bar_widget.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/picker_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/generated/i18n.dart'; @@ -16,12 +17,18 @@ class SearchBarWidget extends StatelessWidget { Widget build(BuildContext context) { return TextFormField( controller: searchController, - style: TextStyle(color: Theme.of(context).primaryTextTheme!.titleLarge!.color!), + style: TextStyle( + color: Theme.of(context).extension()!.searchTextColor), decoration: InputDecoration( hintText: hintText ?? S.of(context).search_currency, - prefixIcon: Image.asset("assets/images/search_icon.png"), + hintStyle: TextStyle( + color: Theme.of(context).extension()!.searchHintColor), + prefixIcon: Image.asset("assets/images/search_icon.png", + color: Theme.of(context).extension()!.searchIconColor), filled: true, - fillColor: Theme.of(context).accentTextTheme!.displaySmall!.color!, + fillColor: Theme.of(context) + .extension()! + .searchBackgroundFillColor, alignLabelWithHint: false, contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16), enabledBorder: OutlineInputBorder( diff --git a/lib/src/widgets/section_divider.dart b/lib/src/widgets/section_divider.dart index bef85f975..b0beda089 100644 --- a/lib/src/widgets/section_divider.dart +++ b/lib/src/widgets/section_divider.dart @@ -1,13 +1,34 @@ import 'package:flutter/material.dart'; class SectionDivider extends StatelessWidget { - const SectionDivider(); + const SectionDivider({required this.direction}); + + final Axis direction; @override Widget build(BuildContext context) { return Container( - height: 1, + height: direction == Axis.horizontal ? 1 : null, + width: direction == Axis.vertical ? 1 : null, color: Theme.of(context).dividerColor, ); } -} \ No newline at end of file +} + +class HorizontalSectionDivider extends StatelessWidget { + const HorizontalSectionDivider(); + + @override + Widget build(BuildContext context) { + return SectionDivider(direction: Axis.horizontal); + } +} + +class VerticalSectionDivider extends StatelessWidget { + const VerticalSectionDivider(); + + @override + Widget build(BuildContext context) { + return SectionDivider(direction: Axis.vertical); + } +} diff --git a/lib/src/widgets/seed_widget.dart b/lib/src/widgets/seed_widget.dart index 0041f9b79..ddafa924b 100644 --- a/lib/src/widgets/seed_widget.dart +++ b/lib/src/widgets/seed_widget.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/src/widgets/validable_annotated_editable_text.dart'; import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart'; @@ -10,6 +11,7 @@ import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/entities/mnemonic_item.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:flutter/widgets.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class SeedWidget extends StatefulWidget { SeedWidget({ @@ -89,10 +91,7 @@ class SeedWidgetState extends State { cursorColor: Colors.blue, backgroundCursorColor: Colors.blue, validStyle: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!, + color: Theme.of(context).extension()!.titleColor, backgroundColor: Colors.transparent, fontWeight: FontWeight.normal, fontSize: 16), @@ -105,10 +104,7 @@ class SeedWidgetState extends State { controller: controller, words: words, textStyle: TextStyle( - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!, + color: Theme.of(context).extension()!.titleColor, backgroundColor: Colors.transparent, fontWeight: FontWeight.normal, fontSize: 16), @@ -128,19 +124,13 @@ class SeedWidgetState extends State { borderRadius: BorderRadius.all(Radius.circular(6))), child: Image.asset('assets/images/paste_ios.png', - color: Theme.of(context) - .primaryTextTheme! - .headlineMedium! - .decorationColor!)), + color: Theme.of(context).extension()!.textFieldButtonIconColor)), ))) ]), Container( margin: EdgeInsets.only(top: 15), height: 1.0, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .backgroundColor!), + color: Theme.of(context).extension()!.textfieldUnderlineColor), ])); } diff --git a/lib/src/widgets/setting_action_button.dart b/lib/src/widgets/setting_action_button.dart index 939e6b857..bebc4b8e1 100644 --- a/lib/src/widgets/setting_action_button.dart +++ b/lib/src/widgets/setting_action_button.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; import 'package:flutter/material.dart'; class SettingActionButton extends StatelessWidget { @@ -29,15 +30,15 @@ class SettingActionButton extends StatelessWidget { @override Widget build(BuildContext context) { Color? color = isSelected - ? Theme.of(context).textTheme!.displaySmall!.color + ? Theme.of(context).extension()!.settingTitleColor : selectionActive ? Palette.darkBlue - : Theme.of(context).textTheme!.displaySmall!.color; + : Theme.of(context).extension()!.settingTitleColor; return InkWell( onTap: onTap, hoverColor: Colors.transparent, child: Container( - height: tileHeight, + height: tileHeight, padding: isLastTile ? EdgeInsets.only( left: 24, @@ -54,7 +55,9 @@ class SettingActionButton extends StatelessWidget { image, height: 16, width: 16, - color: Palette.darkBlue, + color: Theme.of(context) + .extension()! + .settingActionsIconColor, ), SizedBox(width: 16), Expanded( diff --git a/lib/src/widgets/standard_checkbox.dart b/lib/src/widgets/standard_checkbox.dart index b1d14cc92..46c5f8a34 100644 --- a/lib/src/widgets/standard_checkbox.dart +++ b/lib/src/widgets/standard_checkbox.dart @@ -1,5 +1,5 @@ -import 'dart:ui'; -import 'package:flutter/cupertino.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; import 'package:flutter/material.dart'; class StandardCheckbox extends StatelessWidget { @@ -21,12 +21,12 @@ class StandardCheckbox extends StatelessWidget { @override Widget build(BuildContext context) { final baseGradient = LinearGradient(colors: [ - Theme.of(context).primaryTextTheme!.titleMedium!.color!, - Theme.of(context).primaryTextTheme!.titleMedium!.decorationColor!, + Theme.of(context).extension()!.checkboxFirstGradientColor, + Theme.of(context).extension()!.checkboxSecondGradientColor, ], begin: Alignment.centerLeft, end: Alignment.centerRight); final boxBorder = Border.all( - color: borderColor ?? Theme.of(context).primaryTextTheme!.bodySmall!.color!, width: 1.0); + color: borderColor ?? Theme.of(context).extension()!.secondaryTextColor, width: 1.0); final checkedBoxDecoration = BoxDecoration( gradient: gradientBackground ? baseGradient : null, @@ -49,7 +49,7 @@ class StandardCheckbox extends StatelessWidget { child: value ? Icon( Icons.check, - color: iconColor ?? Colors.blue, + color: iconColor ?? Theme.of(context).primaryColor, size: 20.0, ) : Offstage(), @@ -60,7 +60,7 @@ class StandardCheckbox extends StatelessWidget { child: Text( caption, style: TextStyle( - fontSize: 16.0, color: Theme.of(context).primaryTextTheme!.titleLarge!.color!), + fontSize: 16.0, color: Theme.of(context).extension()!.titleColor), )) ], ), diff --git a/lib/src/widgets/standard_list.dart b/lib/src/widgets/standard_list.dart index 5fc094755..530d3969c 100644 --- a/lib/src/widgets/standard_list.dart +++ b/lib/src/widgets/standard_list.dart @@ -1,11 +1,10 @@ -import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/src/widgets/standard_list_card.dart'; import 'package:cake_wallet/src/widgets/standard_list_status_row.dart'; import 'package:flutter/material.dart'; class StandardListRow extends StatelessWidget { - StandardListRow( - {required this.title, required this.isSelected, this.onTap, this.decoration}); + StandardListRow({required this.title, required this.isSelected, this.onTap, this.decoration}); final String title; final bool isSelected; @@ -18,50 +17,54 @@ class StandardListRow extends StatelessWidget { final trailing = buildTrailing(context); return InkWell( - onTap: () => onTap?.call(context), - child: Container( - height: 56, - padding: EdgeInsets.only(left: 24, right: 24), - decoration: decoration ?? BoxDecoration( - color: _backgroundColor(context), + onTap: () => onTap?.call(context), + child: Container( + height: 56, + padding: EdgeInsets.only(left: 24, right: 24), + decoration: decoration ?? + BoxDecoration( + color: Theme.of(context).colorScheme.background, ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - if (leading != null) leading, - buildCenter(context, hasLeftOffset: leading != null), - if (trailing != null) trailing - ]))); + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if (leading != null) leading, + buildCenter(context, hasLeftOffset: leading != null), + if (trailing != null) trailing, + ], + ), + ), + ); } Widget? buildLeading(BuildContext context) => null; Widget buildCenter(BuildContext context, {required bool hasLeftOffset}) { - // FIXME: find better way for keep text on left side. return Expanded( - child: Row(mainAxisAlignment: MainAxisAlignment.start, children: [ - if (hasLeftOffset) SizedBox(width: 10), - Expanded( - child: Text(title, - style: TextStyle( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + if (hasLeftOffset) SizedBox(width: 10), + Expanded( + child: Text( + title, + style: TextStyle( fontSize: 14, fontWeight: FontWeight.normal, color: titleColor(context), + ), ), - ), - ) - ])); + ) + ], + ), + ); } Widget? buildTrailing(BuildContext context) => null; Color titleColor(BuildContext context) => isSelected - ? Palette.blueCraiola - : Theme.of(context).primaryTextTheme.titleLarge!.color!; - - Color _backgroundColor(BuildContext context) { - return Theme.of(context).colorScheme.background; - } + ? Theme.of(context).primaryColor + : Theme.of(context).extension()!.titleColor; } class SectionHeaderListRow extends StatelessWidget { @@ -69,15 +72,12 @@ class SectionHeaderListRow extends StatelessWidget { Widget build(BuildContext context) => Column(children: [ StandardListSeparator(padding: EdgeInsets.only(left: 24)), Container( - width: double.infinity, - height: 40, - color: Theme.of(context).colorScheme.background), + width: double.infinity, height: 40, color: Theme.of(context).colorScheme.background), //StandardListSeparator(padding: EdgeInsets.only(left: 24)) ]); } class StandardListSeparator extends StatelessWidget { - const StandardListSeparator({this.padding, this.height = 1}); final EdgeInsets? padding; @@ -90,11 +90,7 @@ class StandardListSeparator extends StatelessWidget { padding: padding, color: Theme.of(context).colorScheme.background, child: Container( - height: height, - color: Theme.of(context) - .primaryTextTheme - .titleLarge - ?.backgroundColor)); + height: height, color: Theme.of(context).primaryTextTheme.titleLarge?.backgroundColor)); } } @@ -107,11 +103,9 @@ class StandardList extends StatelessWidget { @override Widget build(BuildContext context) { return ListView.separated( - separatorBuilder: (_, __) => - StandardListSeparator(padding: EdgeInsets.only(left: 24)), + separatorBuilder: (_, __) => StandardListSeparator(padding: EdgeInsets.only(left: 24)), itemCount: itemCount, itemBuilder: itemBuilder); - } } @@ -123,51 +117,29 @@ class SectionStandardListItem { } class SectionStandardList extends StatelessWidget { - SectionStandardList( - {required this.itemCounter, - required this.itemBuilder, - required this.sectionCount, - required BuildContext context, - this.dividerPadding = const EdgeInsets.only(left: 24), - this.themeColor, - this.dividerThemeColor, - this.sectionTitleBuilder, - this.hasTopSeparator = false,}) - : totalRows = [] { - totalRows.addAll(transform( - hasTopSeparator, - context, - sectionCount, - itemCounter, - itemBuilder, - sectionTitleBuilder, - themeColor, - dividerThemeColor)); - } + SectionStandardList({ + required this.itemCounter, + required this.itemBuilder, + required this.sectionCount, + this.dividerPadding = const EdgeInsets.only(left: 24), + this.sectionTitleBuilder, + this.hasTopSeparator = false, + }) : totalRows = []; final int sectionCount; final bool hasTopSeparator; final int Function(int sectionIndex) itemCounter; - final Widget Function(BuildContext context, int sectionIndex, int itemIndex) - itemBuilder; - final Widget Function(BuildContext context, int sectionIndex)? - sectionTitleBuilder; + final Widget Function(int sectionIndex, int itemIndex) itemBuilder; + final Widget Function(int sectionIndex)? sectionTitleBuilder; final List totalRows; - final Color? themeColor; - final Color? dividerThemeColor; final EdgeInsets dividerPadding; List transform( bool hasTopSeparator, - BuildContext context, int sectionCount, int Function(int sectionIndex) itemCounter, - Widget Function(BuildContext context, int sectionIndex, int itemIndex) - itemBuilder, - Widget Function(BuildContext context, int sectionIndex)? - sectionTitleBuilder, - Color? themeColor, - Color? dividerThemeColor) { + Widget Function(int sectionIndex, int itemIndex) itemBuilder, + Widget Function(int sectionIndex)? sectionTitleBuilder) { final items = []; for (var sectionIndex = 0; sectionIndex < sectionCount; sectionIndex++) { @@ -176,12 +148,12 @@ class SectionStandardList extends StatelessWidget { } if (sectionTitleBuilder != null) { - items.add(buildTitle(items, sectionIndex, context)); + items.add(buildTitle(items, sectionIndex)); } final itemCount = itemCounter(sectionIndex); - items.addAll(buildSection(itemCount, items, sectionIndex, context)); + items.addAll(buildSection(itemCount, items, sectionIndex)); items.add(sectionIndex + 1 != sectionCount ? SectionHeaderListRow() @@ -191,21 +163,19 @@ class SectionStandardList extends StatelessWidget { return items; } - Widget buildTitle( - List items, int sectionIndex, BuildContext context) { + Widget buildTitle(List items, int sectionIndex) { if (sectionTitleBuilder == null) { throw Exception('Cannot to build title. sectionTitleBuilder is null'); } - return sectionTitleBuilder!.call(context, sectionIndex); + return sectionTitleBuilder!.call(sectionIndex); } - List buildSection(int itemCount, List items, int sectionIndex, - BuildContext context) { + List buildSection(int itemCount, List items, int sectionIndex) { final List section = []; for (var itemIndex = 0; itemIndex < itemCount; itemIndex++) { - final item = itemBuilder(context, sectionIndex, itemIndex); + final item = itemBuilder(sectionIndex, itemIndex); section.add(item); } @@ -214,29 +184,33 @@ class SectionStandardList extends StatelessWidget { @override Widget build(BuildContext context) { + totalRows.clear(); + totalRows.addAll( + transform(hasTopSeparator, sectionCount, itemCounter, itemBuilder, sectionTitleBuilder)); + return ListView.separated( - separatorBuilder: (_, index) { - final row = totalRows[index]; + separatorBuilder: (_, index) { + final row = totalRows[index]; - if (row is StandardListSeparator || row is SectionHeaderListRow) { - return Container(); - } + if (row is StandardListSeparator || row is SectionHeaderListRow) { + return Container(); + } - if (row is StandardListStatusRow || row is TradeDetailsStandardListCard) { - return Container(); - } + if (row is StandardListStatusRow || row is TradeDetailsStandardListCard) { + return Container(); + } - final nextRow = totalRows[index + 1]; + final nextRow = totalRows[index + 1]; - // If current row is pre last and last row is separator. - if (nextRow is StandardListSeparator || - nextRow is SectionHeaderListRow) { - return Container(); - } + // If current row is pre last and last row is separator. + if (nextRow is StandardListSeparator || nextRow is SectionHeaderListRow) { + return Container(); + } - return StandardListSeparator(padding: dividerPadding); - }, - itemCount: totalRows.length, - itemBuilder: (_, index) => totalRows[index]); + return StandardListSeparator(padding: dividerPadding); + }, + itemCount: totalRows.length, + itemBuilder: (_, index) => totalRows[index], + ); } } diff --git a/lib/src/widgets/standard_list_card.dart b/lib/src/widgets/standard_list_card.dart index 27385bd44..4b16e1ad4 100644 --- a/lib/src/widgets/standard_list_card.dart +++ b/lib/src/widgets/standard_list_card.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/themes/theme_base.dart'; @@ -21,8 +22,8 @@ class TradeDetailsStandardListCard extends StatelessWidget { final darkTheme = currentTheme == ThemeType.dark; final baseGradient = LinearGradient(colors: [ - Theme.of(context).primaryTextTheme!.titleSmall!.color!, - Theme.of(context).primaryTextTheme!.titleSmall!.decorationColor!, + Theme.of(context).extension()!.firstGradientTopPanelColor, + Theme.of(context).extension()!.secondGradientTopPanelColor, ], begin: Alignment.centerLeft, end: Alignment.centerRight); final gradient = LinearGradient(colors: [ diff --git a/lib/src/widgets/standard_list_status_row.dart b/lib/src/widgets/standard_list_status_row.dart index 5f5970a24..e24010358 100644 --- a/lib/src/widgets/standard_list_status_row.dart +++ b/lib/src/widgets/standard_list_status_row.dart @@ -1,7 +1,10 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator_icon.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:cake_wallet/themes/extensions/address_theme.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; class StandardListStatusRow extends StatelessWidget { StandardListStatusRow({required this.title, required this.value}); @@ -24,13 +27,13 @@ class StandardListStatusRow extends StatelessWidget { style: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, - color: Theme.of(context).primaryTextTheme!.labelSmall!.color!), + color: Theme.of(context).extension()!.detailsTitlesColor), textAlign: TextAlign.left), Padding( padding: const EdgeInsets.only(top: 12), child: Container( decoration: BoxDecoration( - color: Theme.of(context).accentTextTheme!.displaySmall!.color!, + color: Theme.of(context).extension()!.actionButtonColor, borderRadius: BorderRadius.circular(30.0), ), child: Padding( @@ -50,10 +53,7 @@ class StandardListStatusRow extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge! - .color!)) + color: Theme.of(context).extension()!.titleColor)) ], ), ), diff --git a/lib/src/widgets/standard_switch.dart b/lib/src/widgets/standard_switch.dart index 060e27990..064faea48 100644 --- a/lib/src/widgets/standard_switch.dart +++ b/lib/src/widgets/standard_switch.dart @@ -24,14 +24,8 @@ class StandardSwitchState extends State { height: 28, decoration: BoxDecoration( color: widget.value - ? Theme.of(context) - .accentTextTheme! - .bodyLarge! - .color! - : Theme.of(context) - .accentTextTheme! - .displayLarge! - .color!, + ? Theme.of(context).primaryColor + : Theme.of(context).disabledColor, borderRadius: BorderRadius.all(Radius.circular(14.0))), child: Container( width: 24.0, diff --git a/lib/src/widgets/template_tile.dart b/lib/src/widgets/template_tile.dart index aa285afaf..8f8d5e771 100644 --- a/lib/src/widgets/template_tile.dart +++ b/lib/src/widgets/template_tile.dart @@ -1,5 +1,7 @@ +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; class TemplateTile extends StatefulWidget { TemplateTile({ @@ -49,7 +51,9 @@ class TemplateTileState extends State { @override Widget build(BuildContext context) { - final color = isRemovable ? Colors.white : Theme.of(context).primaryTextTheme!.titleLarge!.color!; + final color = isRemovable + ? Colors.white + : Theme.of(context).extension()!.templateTitleColor; final toIcon = Image.asset('assets/images/to_icon.png', color: color); final content = Row( @@ -109,7 +113,7 @@ class TemplateTileState extends State { child: Container( height: 40, padding: EdgeInsets.only(left: 24, right: 24), - color: Theme.of(context).primaryTextTheme!.displayMedium!.decorationColor!, + color: Theme.of(context).extension()!.templateBackgroundColor, child: content, ), ), @@ -154,4 +158,4 @@ class TemplateTileState extends State { return isRemovable ? removableTile : tile; } -} \ No newline at end of file +} diff --git a/lib/src/widgets/trail_button.dart b/lib/src/widgets/trail_button.dart index b9c430d5d..5e4d1bdf6 100644 --- a/lib/src/widgets/trail_button.dart +++ b/lib/src/widgets/trail_button.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/palette.dart'; @@ -24,10 +25,7 @@ class TrailButton extends StatelessWidget { caption, style: TextStyle( color: textColor ?? - Theme.of(context) - .accentTextTheme! - .displayLarge! - .decorationColor!, + Theme.of(context).extension()!.hintTextColor, fontWeight: FontWeight.w600, fontSize: 14), ), diff --git a/lib/themes/bitcoin_dark_theme.dart b/lib/themes/bitcoin_dark_theme.dart new file mode 100644 index 000000000..f8b842ae8 --- /dev/null +++ b/lib/themes/bitcoin_dark_theme.dart @@ -0,0 +1,14 @@ +import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/monero_dark_theme.dart'; +import 'package:flutter/material.dart'; + +class BitcoinDarkTheme extends MoneroDarkTheme { + BitcoinDarkTheme({required int raw}) : super(raw: raw); + + @override + String get title => S.current.bitcoin_dark_theme; + @override + Color get primaryColor => Palette.bitcoinOrange; +} + diff --git a/lib/themes/bitcoin_light_theme.dart b/lib/themes/bitcoin_light_theme.dart new file mode 100644 index 000000000..14a694221 --- /dev/null +++ b/lib/themes/bitcoin_light_theme.dart @@ -0,0 +1,13 @@ +import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/monero_light_theme.dart'; +import 'package:flutter/material.dart'; + +class BitcoinLightTheme extends MoneroLightTheme { + BitcoinLightTheme({required int raw}) : super(raw: raw); + + @override + String get title => S.current.bitcoin_light_theme; + @override + Color get primaryColor => Palette.bitcoinOrange; +} diff --git a/lib/themes/bright_theme.dart b/lib/themes/bright_theme.dart index 4e5437b64..0ea2bb6f2 100644 --- a/lib/themes/bright_theme.dart +++ b/lib/themes/bright_theme.dart @@ -1,275 +1,126 @@ +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; +import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; +import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; +import 'package:cake_wallet/themes/extensions/order_theme.dart'; +import 'package:cake_wallet/themes/extensions/placeholder_theme.dart'; +import 'package:cake_wallet/themes/extensions/qr_code_theme.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; +import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; +import 'package:cake_wallet/themes/light_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/palette.dart'; import 'package:flutter/material.dart'; -class BrightTheme extends ThemeBase { +class BrightTheme extends LightTheme { BrightTheme({required int raw}) : super(raw: raw); @override String get title => S.current.bright_theme; - @override ThemeType get type => ThemeType.bright; + @override + Color get primaryColor => Palette.moderateSlateBlue; + @override + Color get containerColor => Palette.moderateLavender; - ThemeData theme = ThemeData( - fontFamily: 'Lato', - brightness: Brightness.light, - scaffoldBackgroundColor: Palette.pinkFlamingo, // second gradient color - primaryColor: Palette.redHat, // third gradient color - indicatorColor: Colors.white.withOpacity(0.5), // page indicator - hoverColor: Colors.white, // amount hint text (receive page) - dividerColor: Palette.paleBlue, - hintColor: Palette.gray, - textTheme: TextTheme( - // title -> titleLarge - titleLarge: TextStyle( - color: Colors.white, // sync_indicator text - backgroundColor: Colors.white.withOpacity(0.2), // synced sync_indicator - decorationColor: Colors.white.withOpacity(0.15), // not synced sync_indicator - ), - bodySmall: TextStyle( - color: Palette.shineOrange, // not synced light - decorationColor: Colors.white, // filter icon - ), - labelSmall: TextStyle( - color: Colors.white.withOpacity(0.2), // filter button - backgroundColor: - Colors.white.withOpacity(0.5), // date section row - decorationColor: Colors.white - .withOpacity(0.2) // icons (transaction and trade rows) - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: Colors.white.withOpacity(0.2), // address button border - decorationColor: Colors.white.withOpacity(0.4), // copy button (qr widget) - ), - // headline -> headlineSmall - headlineSmall: TextStyle( - color: Colors.white, // qr code - decorationColor: Colors.white.withOpacity(0.5), // bottom border of amount (receive page) - ), - // display1 -> headlineMedium - headlineMedium: TextStyle( - color: PaletteDark.lightBlueGrey, // icons color (receive page) - decorationColor: Palette.lavender, // icons background (receive page) - ), - // display2 -> displaySmall - displaySmall: TextStyle( - color: - Palette.darkBlueCraiola, // text color of tiles (receive page) - decorationColor: - Colors.white // background of tiles (receive page) - ), - // display3 -> displayMedium - displayMedium: TextStyle( - color: Colors.white, // text color of current tile (receive page), - //decorationColor: Palette.blueCraiola // background of current tile (receive page) - decorationColor: Palette - .moderateSlateBlue // background of current tile (receive page) - ), - // display4 -> displayLarge - displayLarge: TextStyle( - color: Palette.violetBlue, // text color of tiles (account list) - decorationColor: - Colors.white // background of tiles (account list) - ), - // subtitle -> titleSmall - titleSmall: TextStyle( - color: Palette - .moderateSlateBlue, // text color of current tile (account list) - decorationColor: - Colors.white // background of current tile (account list) - ), - // body -> bodyMedium - bodyMedium: TextStyle( - color: Palette.moderatePurpleBlue, // scrollbar thumb - decorationColor: Palette.periwinkleCraiola // scrollbar background - ), - // body2 -> bodyLarge - bodyLarge: TextStyle( - color: Palette.moderateLavender, // menu header - decorationColor: Colors.white, // menu background - ) - ), - scrollbarTheme: ScrollbarThemeData( - thumbColor: MaterialStateProperty.all(Palette.moderatePurpleBlue), - trackColor: MaterialStateProperty.all(Palette.periwinkleCraiola), - radius: Radius.circular(3), - thickness: MaterialStateProperty.all(6), - thumbVisibility: MaterialStateProperty.all(true), - crossAxisMargin: 6, - ), - primaryTextTheme: TextTheme( - titleLarge: TextStyle( - color: Palette.darkBlueCraiola, // title color - backgroundColor: Palette.wildPeriwinkle // textfield underline - ), - bodySmall: TextStyle( - color: PaletteDark.pigeonBlue, // secondary text - decorationColor: Palette.wildLavender // menu divider - ), - labelSmall: TextStyle( - color: Palette.darkGray, // transaction/trade details titles - decorationColor: Colors.white.withOpacity(0.5), // placeholder - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: Palette.blueCraiola, // first gradient color (send page) - decorationColor: - Palette.pinkFlamingo // second gradient color (send page) - ), - // headline -> headlineSmall - headlineSmall: TextStyle( - color: Colors.white - .withOpacity(0.5), // text field border color (send page) - decorationColor: Colors.white - .withOpacity(0.5), // text field hint color (send page) - ), - // display1 -> headlineMedium - headlineMedium: TextStyle( - color: Colors.white - .withOpacity(0.2), // text field button color (send page) - decorationColor: - Colors.white // text field button icon color (send page) - ), - // display2 -> displaySmall - displaySmall: TextStyle( - color: Colors.white.withOpacity(0.5), // estimated fee (send page) - backgroundColor: PaletteDark.darkCyanBlue - .withOpacity(0.67), // dot color for indicator on send page - decorationColor: - Palette.shadowWhite // template dotted border (send page) - ), - // display3 -> displayMedium - displayMedium: TextStyle( - color: Palette.darkBlueCraiola, // template new text (send page) - backgroundColor: PaletteDark - .darkNightBlue, // active dot color for indicator on send page - decorationColor: - Palette.shadowWhite // template background color (send page) - ), - // display4 -> displayLarge - displayLarge: TextStyle( - color: Palette.darkBlueCraiola, // template title (send page) - backgroundColor: - Colors.white, // icon color on order row (moonpay) - decorationColor: - Palette.niagara // receive amount text (exchange page) - ), - // subtitle -> titleSmall - titleSmall: TextStyle( - color: Palette - .blueCraiola, // first gradient color top panel (exchange page) - decorationColor: Palette - .pinkFlamingo // second gradient color top panel (exchange page) - ), - // body -> bodyMedium - bodyMedium: TextStyle( - color: Palette.blueCraiola.withOpacity( - 0.7), // first gradient color bottom panel (exchange page) - decorationColor: Palette.pinkFlamingo.withOpacity( - 0.7), // second gradient color bottom panel (exchange page) - backgroundColor: - Palette.moderateSlateBlue // alert right button text - ), - // body2 -> bodyLarge - bodyLarge: TextStyle( - color: Colors.white.withOpacity( - 0.5), // text field border on top panel (exchange page) - decorationColor: Colors.white.withOpacity( - 0.5), // text field border on bottom panel (exchange page) - backgroundColor: Palette.brightOrange // alert left button text - ) - ), - focusColor: Colors.white.withOpacity(0.2), // text field button (exchange page) - accentTextTheme: TextTheme( - // title -> titleLarge - titleLarge: TextStyle( - color: Colors.white, // picker background - backgroundColor: Palette.periwinkleCraiola, // picker divider - decorationColor: Colors.white // dialog background - ), - bodySmall: TextStyle( - color: Palette.moderateLavender, // container (confirm exchange) - backgroundColor: Palette.moderateLavender, // button background (confirm exchange) - decorationColor: Palette.darkBlueCraiola, // text color (information page) - ), - // subtitle -> titleSmall - titleSmall: TextStyle( - color: Palette.darkBlueCraiola, // QR code (exchange trade page) - backgroundColor: Palette.wildPeriwinkle, // divider (exchange trade page) - //decorationColor: Palette.blueCraiola // crete new wallet button background (wallet list page) - decorationColor: Palette - .moderateSlateBlue // crete new wallet button background (wallet list page) - ), - // headline -> headlineSmall - headlineSmall: TextStyle( - color: Palette - .moderateLavender, // first gradient color of wallet action buttons (wallet list page) - backgroundColor: Palette - .moderateLavender, // second gradient color of wallet action buttons (wallet list page) - decorationColor: Colors - .white // restore wallet button text color (wallet list page) - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: Palette.darkGray, // titles color (filter widget) - backgroundColor: Palette.periwinkle, // divider color (filter widget) - decorationColor: Colors.white // checkbox background (filter widget) - ), - labelSmall: TextStyle( - color: Palette.wildPeriwinkle, // checkbox bounds (filter widget) - decorationColor: Colors.white, // menu subname - ), - // display1 -> headlineMedium - headlineMedium: TextStyle( - color: Palette.blueCraiola, // first gradient color (menu header) - decorationColor: Palette.pinkFlamingo, // second gradient color(menu header) - backgroundColor: Colors.white // active dot color - ), - // display2 -> displaySmall - displaySmall: TextStyle( - color: - Palette.shadowWhite, // action button color (address text field) - decorationColor: Palette.darkGray, // hint text (seed widget) - backgroundColor: - Colors.white.withOpacity(0.5) // text on balance page - ), - // display3 -> displayMedium - displayMedium: TextStyle( - color: Palette.darkGray, // hint text (new wallet page) - decorationColor: - Palette.periwinkleCraiola, // underline (new wallet page) - backgroundColor: - Colors.white // menu, icons, balance (dashboard page) - ), - // display4 -> displayLarge - displayLarge: TextStyle( - color: Palette.darkGray, // switch background (settings page) - backgroundColor: - Colors.black, // icon color on support page (moonpay, github) - decorationColor: - Colors.white.withOpacity(0.4) // hint text (exchange page) - ), - // body -> bodyMedium - bodyMedium: TextStyle( - color: Palette.darkGray, // indicators (PIN code) - decorationColor: Palette.darkGray, // switch (PIN code) - backgroundColor: Colors.white // alert right button - ), - // body2 -> bodyLarge - bodyLarge: TextStyle( - color: Palette.moderateSlateBlue, // primary buttons - decorationColor: Colors.white, // alert left button, - backgroundColor: Palette.dullGray // keyboard bar color - ), - ), - cardColor: Palette.moderateSlateBlue // bottom button (action list) + @override + DashboardPageTheme get dashboardPageTheme => + super.dashboardPageTheme.copyWith( + firstGradientBackgroundColor: Palette.blueCraiola, + secondGradientBackgroundColor: Palette.pinkFlamingo, + thirdGradientBackgroundColor: Palette.redHat, + pageTitleTextColor: Colors.white, + mainActionsIconColor: Colors.white, + textColor: Colors.white, + cardTextColor: Colors.white, + indicatorDotTheme: IndicatorDotTheme( + indicatorColor: Colors.white.withOpacity(0.5), + activeIndicatorColor: Colors.white)); + + @override + SyncIndicatorTheme get syncIndicatorStyle => + super.syncIndicatorStyle.copyWith( + textColor: Colors.white, + syncedBackgroundColor: Colors.white.withOpacity(0.2), + notSyncedBackgroundColor: Colors.white.withOpacity(0.15)); + + @override + ExchangePageTheme get exchangePageTheme => super.exchangePageTheme.copyWith( + secondGradientBottomPanelColor: Palette.pinkFlamingo.withOpacity(0.7), + firstGradientBottomPanelColor: Palette.blueCraiola.withOpacity(0.7), + secondGradientTopPanelColor: Palette.pinkFlamingo, + firstGradientTopPanelColor: Palette.blueCraiola); + + @override + NewWalletTheme get newWalletTheme => super.newWalletTheme.copyWith( + hintTextColor: Palette.darkGray, + underlineColor: Palette.periwinkleCraiola); + + @override + BalancePageTheme get balancePageTheme => super + .balancePageTheme + .copyWith(labelTextColor: Colors.white.withOpacity(0.5)); + + @override + CakeMenuTheme get menuTheme => + super.menuTheme.copyWith(headerSecondGradientColor: Palette.pinkFlamingo); + + @override + FilterTheme get filterTheme => super.filterTheme.copyWith( + checkboxSecondGradientColor: Palette.pinkFlamingo, + checkboxBackgroundColor: Colors.white, + buttonColor: Colors.white.withOpacity(0.2), + iconColor: Colors.white); + + @override + WalletListTheme get walletListTheme => super.walletListTheme.copyWith( + createNewWalletButtonBackgroundColor: Palette.moderateSlateBlue); + + @override + OrderTheme get orderTheme => OrderTheme(iconColor: Colors.white); + + @override + SendPageTheme get sendPageTheme => super.sendPageTheme.copyWith( + templateBackgroundColor: Palette.shadowWhite, + templateDottedBorderColor: Palette.shadowWhite, + secondGradientColor: Palette.pinkFlamingo); + + @override + PlaceholderTheme get placeholderTheme => + PlaceholderTheme(color: Colors.white.withOpacity(0.5)); + + @override + TransactionTradeTheme get transactionTradeTheme => super + .transactionTradeTheme + .copyWith(rowsColor: Colors.white.withOpacity(0.2)); + + @override + ReceivePageTheme get receivePageTheme => super.receivePageTheme.copyWith( + currentTileBackgroundColor: Palette.moderateSlateBlue, + tilesBackgroundColor: Colors.white, + iconsBackgroundColor: Palette.lavender, + amountBottomBorderColor: Colors.white.withOpacity(0.5), + amountHintTextColor: Colors.white, ); @override - ThemeData get themeData => theme.copyWith( - colorScheme: theme.colorScheme - .copyWith(background: Colors.white, secondary: Palette.blueCraiola)); + QRCodeTheme get qrCodeTheme => super + .qrCodeTheme + .copyWith(qrWidgetCopyButtonColor: Colors.white.withOpacity(0.4)); + + @override + CakeTextTheme get cakeTextTheme => super.cakeTextTheme.copyWith( + buttonSecondaryTextColor: super.cakeTextTheme.secondaryTextColor, + buttonTextColor: super.cakeTextTheme.titleColor, + addressButtonBorderColor: Colors.white.withOpacity(0.4), + dateSectionRowColor: Colors.white.withOpacity(0.5)); } diff --git a/lib/themes/dark_theme.dart b/lib/themes/dark_theme.dart index e8cfab633..747dc2527 100644 --- a/lib/themes/dark_theme.dart +++ b/lib/themes/dark_theme.dart @@ -1,3 +1,29 @@ +import 'package:cake_wallet/themes/extensions/account_list_theme.dart'; +import 'package:cake_wallet/themes/extensions/address_theme.dart'; +import 'package:cake_wallet/themes/extensions/alert_theme.dart'; +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; +import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart'; +import 'package:cake_wallet/themes/extensions/info_theme.dart'; +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; +import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; +import 'package:cake_wallet/themes/extensions/order_theme.dart'; +import 'package:cake_wallet/themes/extensions/picker_theme.dart'; +import 'package:cake_wallet/themes/extensions/pin_code_theme.dart'; +import 'package:cake_wallet/themes/extensions/placeholder_theme.dart'; +import 'package:cake_wallet/themes/extensions/qr_code_theme.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/support_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; +import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/palette.dart'; @@ -8,278 +34,194 @@ class DarkTheme extends ThemeBase { @override String get title => S.current.dark_theme; - @override ThemeType get type => ThemeType.dark; - - ThemeData theme = ThemeData( - fontFamily: 'Lato', - brightness: Brightness.dark, - scaffoldBackgroundColor: - PaletteDark.backgroundColor, // second gradient color - primaryColor: PaletteDark.backgroundColor, // third gradient color - indicatorColor: PaletteDark.cyanBlue, // page indicator - hoverColor: PaletteDark.cyanBlue, // amount hint text (receive page) - dividerColor: PaletteDark.dividerColor, - hintColor: PaletteDark.pigeonBlue, // menu - textTheme: TextTheme( - // title -> titleLarge - titleLarge: TextStyle( - color: PaletteDark.wildBlue, // sync_indicator text - backgroundColor: - PaletteDark.lightNightBlue, // synced sync_indicator - decorationColor: - PaletteDark.oceanBlue // not synced sync_indicator - ), - bodySmall: TextStyle( - color: PaletteDark.orangeYellow, // not synced light - decorationColor: PaletteDark.wildBlue, // filter icon - ), - labelSmall: TextStyle( - color: PaletteDark.oceanBlue, // filter button - backgroundColor: PaletteDark.darkCyanBlue, // date section row - decorationColor: PaletteDark - .wildNightBlue // icons (transaction and trade rows) - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: PaletteDark.nightBlue, // address button border - decorationColor: PaletteDark.lightBlueGrey, // copy button (qr widget) - ), - // headline -> headlineSmall - headlineSmall: TextStyle( - color: PaletteDark.lightBlueGrey, // qr code - decorationColor: PaletteDark.darkGrey, // bottom border of amount (receive page) - ), - // display1 -> headlineMedium - headlineMedium: TextStyle( - color: Colors.white, // icons color (receive page) - decorationColor: PaletteDark.distantNightBlue, // icons background (receive page) - ), - // display2 -> displaySmall - displaySmall: TextStyle( - color: Colors.white, // text color of tiles (receive page) - decorationColor: - PaletteDark.nightBlue // background of tiles (receive page) - ), - // display3 -> displayMedium - displayMedium: TextStyle( - color: Palette - .blueCraiola, // text color of current tile (receive page) - decorationColor: PaletteDark - .lightOceanBlue // background of current tile (receive page) - ), - // display4 -> displayLarge - displayLarge: TextStyle( - color: Colors.white, // text color of tiles (account list) - decorationColor: PaletteDark - .darkOceanBlue // background of tiles (account list) - ), - // subtitle -> titleSmall - titleSmall: TextStyle( - color: Palette - .blueCraiola, // text color of current tile (account list) - decorationColor: PaletteDark - .darkNightBlue // background of current tile (account list) - ), - // body1 -> bodyMedium - bodyMedium: TextStyle( - color: PaletteDark.wildBlueGrey, // scrollbar thumb - decorationColor: PaletteDark.violetBlue // scrollbar background - ), - // body2 -> bodyLarge - bodyLarge: TextStyle( - color: PaletteDark.deepPurpleBlue, // menu header - decorationColor: PaletteDark.deepPurpleBlue, // menu background - ) - ), - scrollbarTheme: ScrollbarThemeData( - thumbColor: MaterialStateProperty.all(PaletteDark.wildBlueGrey), - trackColor: MaterialStateProperty.all(PaletteDark.violetBlue), - radius: Radius.circular(3), - thickness: MaterialStateProperty.all(6), - thumbVisibility: MaterialStateProperty.all(true), - crossAxisMargin: 6, - ), - primaryTextTheme: TextTheme( - // title -> titleLarge - titleLarge: TextStyle( - color: Colors.white, // title color - backgroundColor: PaletteDark.darkOceanBlue // textfield underline - ), - bodySmall: TextStyle( - color: PaletteDark.darkCyanBlue, // secondary text - decorationColor: PaletteDark.darkOceanBlue // menu divider - ), - labelSmall: TextStyle( - color: - PaletteDark.lightBlueGrey, // transaction/trade details titles - decorationColor: Colors.grey, // placeholder - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: - PaletteDark.darkNightBlue, // first gradient color (send page) - decorationColor: - PaletteDark.darkNightBlue // second gradient color (send page) - ), - // headline -> headlineSmall - headlineSmall: TextStyle( - color: PaletteDark - .lightVioletBlue, // text field border color (send page) - decorationColor: - PaletteDark.darkCyanBlue, // text field hint color (send page) - ), - // display1 -> headlineMedium - headlineMedium: TextStyle( - color: PaletteDark - .buttonNightBlue, // text field button color (send page) - decorationColor: - PaletteDark.gray // text field button icon color (send page) - ), - // display2 -> displaySmall - displaySmall: TextStyle( - color: Colors.white, // estimated fee (send page) - backgroundColor: - PaletteDark.cyanBlue, // dot color for indicator on send page - decorationColor: - PaletteDark.darkCyanBlue // template dotted border (send page) - ), - // display3 -> displayMedium - displayMedium: TextStyle( - color: PaletteDark.darkCyanBlue, // template new text (send page) - backgroundColor: - Colors.white, // active dot color for indicator on send page - decorationColor: PaletteDark - .darkVioletBlue // template background color (send page) - ), - // display4 -> displayLarge - displayLarge: TextStyle( - color: PaletteDark.cyanBlue, // template title (send page) - backgroundColor: - Colors.white, // icon color on order row (moonpay) - decorationColor: PaletteDark - .darkCyanBlue // receive amount text (exchange page) - ), - // subtitle -> titleSmall - titleSmall: TextStyle( - color: PaletteDark - .wildVioletBlue, // first gradient color top panel (exchange page) - decorationColor: PaletteDark - .wildVioletBlue // second gradient color top panel (exchange page) - ), - // body1 -> bodyMedium - bodyMedium: TextStyle( - color: PaletteDark - .darkNightBlue, // first gradient color bottom panel (exchange page) - decorationColor: PaletteDark - .darkNightBlue, // second gradient color bottom panel (exchange page) - backgroundColor: Palette.blueCraiola // alert right button text - ), - // body2 -> bodyLarge - bodyLarge: TextStyle( - color: PaletteDark - .blueGrey, // text field border on top panel (exchange page) - decorationColor: PaletteDark - .moderateVioletBlue, // text field border on bottom panel (exchange page) - backgroundColor: Palette.alizarinRed // alert left button text - ) - ), - focusColor: PaletteDark.moderateBlue, // text field button (exchange page) - accentTextTheme: TextTheme( - // title -> titleLarge - titleLarge: TextStyle( - color: PaletteDark.nightBlue, // picker background - backgroundColor: PaletteDark.dividerColor, // picker divider - decorationColor: PaletteDark.darkNightBlue // dialog background - ), - bodySmall: TextStyle( - color: PaletteDark.nightBlue, // container (confirm exchange) - backgroundColor: PaletteDark.deepVioletBlue, // button background (confirm exchange) - decorationColor: Palette.darkLavender, // text color (information page) - ), - // subtitle -> titleSmall - titleSmall: TextStyle( - //color: PaletteDark.lightBlueGrey, // QR code (exchange trade page) - color: Colors.white, // QR code (exchange trade page) - backgroundColor: - PaletteDark.deepVioletBlue, // divider (exchange trade page) - decorationColor: Colors - .white // crete new wallet button background (wallet list page) - ), - // headline -> headlineSmall - headlineSmall: TextStyle( - color: PaletteDark - .distantBlue, // first gradient color of wallet action buttons (wallet list page) - backgroundColor: PaletteDark - .distantNightBlue, // second gradient color of wallet action buttons (wallet list page) - decorationColor: Palette - .darkBlueCraiola // restore wallet button text color (wallet list page) - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: Colors.white, // titles color (filter widget) - backgroundColor: - PaletteDark.darkOceanBlue, // divider color (filter widget) - decorationColor: PaletteDark.wildVioletBlue - .withOpacity(0.3) // checkbox background (filter widget) - ), - labelSmall: TextStyle( - color: PaletteDark.wildVioletBlue, // checkbox bounds (filter widget) - decorationColor: PaletteDark.darkCyanBlue, // menu subname - ), - // display1 -> headlineMedium - headlineMedium: TextStyle( - color: PaletteDark - .deepPurpleBlue, // first gradient color (menu header) - decorationColor: PaletteDark - .deepPurpleBlue, // second gradient color(menu header) - backgroundColor: Colors.white // active dot color - ), - // display2 -> displaySmall - displaySmall: TextStyle( - color: PaletteDark - .nightBlue, // action button color (address text field) - decorationColor: - PaletteDark.darkCyanBlue, // hint text (seed widget) - backgroundColor: PaletteDark.cyanBlue // text on balance page - ), - // display3 -> displayMedium - displayMedium: TextStyle( - color: PaletteDark.cyanBlue, // hint text (new wallet page) - decorationColor: - PaletteDark.darkGrey, // underline (new wallet page) - backgroundColor: - Colors.white // menu, icons, balance (dashboard page) - ), - // display4 -> displayLarge - displayLarge: TextStyle( - color: - PaletteDark.deepVioletBlue, // switch background (settings page) - backgroundColor: - Colors.white, // icon color on support page (moonpay, github) - decorationColor: - PaletteDark.lightBlueGrey // hint text (exchange page) - ), - // body1 -> bodyMedium - bodyMedium: TextStyle( - color: PaletteDark.indicatorVioletBlue, // indicators (PIN code) - decorationColor: PaletteDark.lightPurpleBlue, // switch (PIN code) - backgroundColor: PaletteDark.darkNightBlue // alert right button - ), - // body2 -> bodyLarge - bodyLarge: TextStyle( - color: Palette.blueCraiola, // primary buttons - decorationColor: PaletteDark.darkNightBlue, // alert left button - backgroundColor: PaletteDark.granite // keyboard bar color - ), - ), - cardColor: PaletteDark.darkNightBlue // bottom button (action list) - ); + @override + Brightness get brightness => Brightness.dark; + @override + Color get backgroundColor => PaletteDark.backgroundColor; + @override + Color get primaryColor => Palette.blueCraiola; + @override + Color get primaryTextColor => Colors.white; + @override + Color get containerColor => PaletteDark.nightBlue; + @override + Color get dialogBackgroundColor => PaletteDark.darkNightBlue; @override - ThemeData get themeData => theme.copyWith( - colorScheme: theme.colorScheme.copyWith( - background: PaletteDark.backgroundColor, - secondary: PaletteDark.backgroundColor)); + CakeScrollbarTheme get scrollbarTheme => CakeScrollbarTheme( + thumbColor: PaletteDark.wildBlueGrey, trackColor: PaletteDark.violetBlue); + + @override + SyncIndicatorTheme get syncIndicatorStyle => SyncIndicatorTheme( + textColor: PaletteDark.wildBlue, + syncedBackgroundColor: PaletteDark.lightNightBlue, + notSyncedIconColor: PaletteDark.orangeYellow, + notSyncedBackgroundColor: PaletteDark.oceanBlue); + + @override + KeyboardTheme get keyboardTheme => + KeyboardTheme(keyboardBarColor: PaletteDark.granite); + + @override + PinCodeTheme get pinCodeTheme => PinCodeTheme( + indicatorsColor: PaletteDark.indicatorVioletBlue, + switchColor: PaletteDark.lightPurpleBlue); + + @override + SupportPageTheme get supportPageTheme => + SupportPageTheme(iconColor: Colors.white); + + @override + ExchangePageTheme get exchangePageTheme => ExchangePageTheme( + hintTextColor: PaletteDark.lightBlueGrey, + dividerCodeColor: PaletteDark.deepVioletBlue, + qrCodeColor: primaryTextColor, + buttonBackgroundColor: PaletteDark.deepVioletBlue, + textFieldButtonColor: PaletteDark.moderateBlue, + textFieldBorderBottomPanelColor: PaletteDark.moderateVioletBlue, + textFieldBorderTopPanelColor: PaletteDark.blueGrey, + secondGradientBottomPanelColor: PaletteDark.darkNightBlue, + firstGradientBottomPanelColor: PaletteDark.darkNightBlue, + secondGradientTopPanelColor: PaletteDark.wildVioletBlue, + firstGradientTopPanelColor: PaletteDark.wildVioletBlue, + receiveAmountColor: PaletteDark.darkCyanBlue); + + @override + NewWalletTheme get newWalletTheme => NewWalletTheme( + hintTextColor: PaletteDark.cyanBlue, + underlineColor: PaletteDark.darkGrey); + + @override + AddressTheme get addressTheme => + AddressTheme(actionButtonColor: PaletteDark.nightBlue); + + @override + DashboardPageTheme get dashboardPageTheme => + super.dashboardPageTheme.copyWith( + cardTextColor: super.dashboardPageTheme.textColor, + indicatorDotTheme: IndicatorDotTheme( + indicatorColor: PaletteDark.cyanBlue, + activeIndicatorColor: Colors.white)); + + @override + BalancePageTheme get balancePageTheme => BalancePageTheme( + textColor: dashboardPageTheme.textColor, + labelTextColor: PaletteDark.cyanBlue); + + @override + CakeMenuTheme get menuTheme => CakeMenuTheme( + headerFirstGradientColor: PaletteDark.deepPurpleBlue, + headerSecondGradientColor: PaletteDark.deepPurpleBlue, + backgroundColor: PaletteDark.deepPurpleBlue, + subnameTextColor: PaletteDark.darkCyanBlue, + dividerColor: PaletteDark.darkOceanBlue, + settingTitleColor: receivePageTheme.tilesTextColor, + settingActionsIconColor: PaletteDark.pigeonBlue, + iconColor: PaletteDark.darkCyanBlue); + + @override + FilterTheme get filterTheme => FilterTheme( + checkboxFirstGradientColor: PaletteDark.darkNightBlue, + checkboxSecondGradientColor: PaletteDark.darkNightBlue, + checkboxBoundsColor: PaletteDark.wildVioletBlue, + checkboxBackgroundColor: PaletteDark.wildVioletBlue.withOpacity(0.3), + titlesColor: Colors.white, + buttonColor: PaletteDark.oceanBlue, + iconColor: PaletteDark.wildBlue); + + @override + WalletListTheme get walletListTheme => WalletListTheme( + restoreWalletButtonTextColor: Palette.darkBlueCraiola, + createNewWalletButtonBackgroundColor: Colors.white); + + @override + InfoTheme get infoTheme => InfoTheme(textColor: Palette.darkLavender); + + @override + PickerTheme get pickerTheme => PickerTheme( + dividerColor: PaletteDark.dividerColor, + searchTextColor: cakeTextTheme.textfieldUnderlineColor, + searchBackgroundFillColor: addressTheme.actionButtonColor); + + @override + AlertTheme get alertTheme => AlertTheme( + backdropColor: PaletteDark.darkNightBlue.withOpacity(0.75), + leftButtonTextColor: Palette.alizarinRed); + + @override + OrderTheme get orderTheme => OrderTheme(iconColor: Colors.white); + + @override + SendPageTheme get sendPageTheme => SendPageTheme( + templateTitleColor: PaletteDark.cyanBlue, + templateBackgroundColor: PaletteDark.darkVioletBlue, + templateNewTextColor: PaletteDark.darkCyanBlue, + templateDottedBorderColor: PaletteDark.darkCyanBlue, + templateSelectedCurrencyBackgroundColor: primaryColor, + templateSelectedCurrencyTitleColor: Colors.white, + estimatedFeeColor: Colors.white, + textFieldButtonIconColor: PaletteDark.gray, + textFieldButtonColor: PaletteDark.buttonNightBlue, + textFieldHintColor: PaletteDark.darkCyanBlue, + textFieldBorderColor: PaletteDark.lightVioletBlue, + secondGradientColor: PaletteDark.darkNightBlue, + firstGradientColor: PaletteDark.darkNightBlue, + indicatorDotColor: PaletteDark.cyanBlue); + + @override + SeedWidgetTheme get seedWidgetTheme => + SeedWidgetTheme(hintTextColor: PaletteDark.darkCyanBlue); + + @override + PlaceholderTheme get placeholderTheme => PlaceholderTheme(color: Colors.grey); + + @override + TransactionTradeTheme get transactionTradeTheme => TransactionTradeTheme( + detailsTitlesColor: PaletteDark.lightBlueGrey, + rowsColor: PaletteDark.wildNightBlue); + + @override + CakeTextTheme get cakeTextTheme => CakeTextTheme( + secondaryTextColor: PaletteDark.darkCyanBlue, + textfieldUnderlineColor: PaletteDark.darkOceanBlue, + titleColor: Colors.white, + addressButtonBorderColor: PaletteDark.nightBlue, + dateSectionRowColor: PaletteDark.darkCyanBlue); + + @override + AccountListTheme get accountListTheme => AccountListTheme( + currentAccountBackgroundColor: dialogBackgroundColor, + currentAccountTextColor: primaryColor, + currentAccountAmountColor: receivePageTheme.iconsColor, + tilesAmountColor: receivePageTheme.iconsColor, + tilesBackgroundColor: PaletteDark.darkOceanBlue, + tilesTextColor: Colors.white); + + @override + ReceivePageTheme get receivePageTheme => ReceivePageTheme( + currentTileBackgroundColor: PaletteDark.lightOceanBlue, + currentTileTextColor: Palette.blueCraiola, + tilesBackgroundColor: PaletteDark.nightBlue, + tilesTextColor: Colors.white, + iconsBackgroundColor: PaletteDark.distantNightBlue, + iconsColor: Colors.white, + amountBottomBorderColor: PaletteDark.darkGrey, + amountHintTextColor: PaletteDark.cyanBlue); + + @override + QRCodeTheme get qrCodeTheme => QRCodeTheme( + qrCodeColor: PaletteDark.lightBlueGrey, + qrWidgetCopyButtonColor: PaletteDark.lightBlueGrey); + + @override + ThemeData get themeData => super.themeData.copyWith( + dividerColor: PaletteDark.dividerColor, + hintColor: PaletteDark.pigeonBlue, + disabledColor: PaletteDark.deepVioletBlue, + dialogTheme: super + .themeData + .dialogTheme + .copyWith(backgroundColor: PaletteDark.nightBlue)); } diff --git a/lib/themes/extensions/account_list_theme.dart b/lib/themes/extensions/account_list_theme.dart new file mode 100644 index 000000000..7f2641e33 --- /dev/null +++ b/lib/themes/extensions/account_list_theme.dart @@ -0,0 +1,58 @@ +import 'package:flutter/material.dart'; + +class AccountListTheme extends ThemeExtension { + final Color tilesTextColor; + final Color tilesAmountColor; + final Color tilesBackgroundColor; + final Color currentAccountBackgroundColor; + final Color currentAccountTextColor; + final Color currentAccountAmountColor; + + AccountListTheme( + {required this.tilesTextColor, + required this.tilesAmountColor, + required this.tilesBackgroundColor, + required this.currentAccountBackgroundColor, + required this.currentAccountTextColor, + required this.currentAccountAmountColor}); + + @override + AccountListTheme copyWith( + {Color? tilesTextColor, + Color? tilesAmountColor, + Color? tilesBackgroundColor, + Color? currentAccountBackgroundColor, + Color? currentAccountTextColor, + Color? currentAccountAmountColor}) => + AccountListTheme( + tilesTextColor: tilesTextColor ?? this.tilesTextColor, + tilesAmountColor: tilesAmountColor ?? this.tilesAmountColor, + tilesBackgroundColor: + tilesBackgroundColor ?? this.tilesBackgroundColor, + currentAccountBackgroundColor: currentAccountBackgroundColor ?? + this.currentAccountBackgroundColor, + currentAccountTextColor: + currentAccountTextColor ?? this.currentAccountTextColor, + currentAccountAmountColor: + currentAccountAmountColor ?? this.currentAccountAmountColor); + + @override + AccountListTheme lerp(ThemeExtension? other, double t) { + if (other is! AccountListTheme) { + return this; + } + + return AccountListTheme( + tilesTextColor: Color.lerp(tilesTextColor, other.tilesTextColor, t)!, + tilesAmountColor: + Color.lerp(tilesAmountColor, other.tilesAmountColor, t)!, + tilesBackgroundColor: + Color.lerp(tilesBackgroundColor, other.tilesBackgroundColor, t)!, + currentAccountBackgroundColor: Color.lerp(currentAccountBackgroundColor, + other.currentAccountBackgroundColor, t)!, + currentAccountTextColor: Color.lerp( + currentAccountTextColor, other.currentAccountTextColor, t)!, + currentAccountAmountColor: Color.lerp( + currentAccountAmountColor, other.currentAccountAmountColor, t)!); + } +} diff --git a/lib/themes/extensions/address_theme.dart b/lib/themes/extensions/address_theme.dart new file mode 100644 index 000000000..cabc8d87f --- /dev/null +++ b/lib/themes/extensions/address_theme.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; + +class AddressTheme extends ThemeExtension { + final Color actionButtonColor; + + AddressTheme({required this.actionButtonColor}); + + @override + AddressTheme copyWith({Color? actionButtonColor}) => AddressTheme( + actionButtonColor: actionButtonColor ?? this.actionButtonColor); + + @override + AddressTheme lerp(ThemeExtension? other, double t) { + if (other is! AddressTheme) { + return this; + } + + return AddressTheme( + actionButtonColor: + Color.lerp(actionButtonColor, other.actionButtonColor, t) ?? + actionButtonColor, + ); + } +} diff --git a/lib/themes/extensions/alert_theme.dart b/lib/themes/extensions/alert_theme.dart new file mode 100644 index 000000000..3794124f3 --- /dev/null +++ b/lib/themes/extensions/alert_theme.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; + +class AlertTheme extends ThemeExtension { + final Color leftButtonTextColor; + final Color backdropColor; + + AlertTheme({required this.leftButtonTextColor, required this.backdropColor}); + + @override + AlertTheme copyWith({Color? leftButtonTextColor, Color? backdropColor}) => + AlertTheme( + leftButtonTextColor: leftButtonTextColor ?? this.leftButtonTextColor, + backdropColor: backdropColor ?? this.backdropColor); + + @override + AlertTheme lerp(ThemeExtension? other, double t) { + if (other is! AlertTheme) { + return this; + } + + return AlertTheme( + leftButtonTextColor: + Color.lerp(leftButtonTextColor, other.leftButtonTextColor, t) ?? + leftButtonTextColor, + backdropColor: + Color.lerp(backdropColor, other.backdropColor, t) ?? backdropColor); + } +} diff --git a/lib/themes/extensions/balance_page_theme.dart b/lib/themes/extensions/balance_page_theme.dart new file mode 100644 index 000000000..508514f93 --- /dev/null +++ b/lib/themes/extensions/balance_page_theme.dart @@ -0,0 +1,53 @@ +import 'package:flutter/material.dart'; + +class BalancePageTheme extends ThemeExtension { + final Color textColor; + final Color labelTextColor; + final Color balanceAmountColor; + final Color assetTitleColor; + final Color cardBorderColor; + + BalancePageTheme( + {required this.labelTextColor, + required this.textColor, + Color? balanceAmountColor, + Color? assetTitleColor, + this.cardBorderColor = Colors.transparent}) + : this.balanceAmountColor = balanceAmountColor ?? textColor, + this.assetTitleColor = assetTitleColor ?? textColor; + + @override + BalancePageTheme copyWith( + {Color? textColor, + Color? labelTextColor, + Color? balanceAmountColor, + Color? assetTitleColor, + Color? cardBorderColor}) => + BalancePageTheme( + textColor: textColor ?? this.textColor, + labelTextColor: labelTextColor ?? this.labelTextColor, + balanceAmountColor: balanceAmountColor ?? this.balanceAmountColor, + assetTitleColor: assetTitleColor ?? this.assetTitleColor, + cardBorderColor: cardBorderColor ?? this.cardBorderColor); + + @override + BalancePageTheme lerp(ThemeExtension? other, double t) { + if (other is! BalancePageTheme) { + return this; + } + + return BalancePageTheme( + textColor: Color.lerp(textColor, other.textColor, t) ?? textColor, + labelTextColor: Color.lerp(labelTextColor, other.labelTextColor, t) ?? + labelTextColor, + balanceAmountColor: + Color.lerp(balanceAmountColor, other.balanceAmountColor, t) ?? + balanceAmountColor, + assetTitleColor: + Color.lerp(assetTitleColor, other.assetTitleColor, t) ?? + assetTitleColor, + cardBorderColor: + Color.lerp(cardBorderColor, other.cardBorderColor, t) ?? + cardBorderColor); + } +} diff --git a/lib/themes/extensions/cake_scrollbar_theme.dart b/lib/themes/extensions/cake_scrollbar_theme.dart new file mode 100644 index 000000000..5aeeafa25 --- /dev/null +++ b/lib/themes/extensions/cake_scrollbar_theme.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; + +class CakeScrollbarTheme extends ThemeExtension { + final Color thumbColor; + final Color trackColor; + + CakeScrollbarTheme({required this.thumbColor, required this.trackColor}); + + @override + Object get type => CakeScrollbarTheme; + + @override + CakeScrollbarTheme copyWith({Color? thumbColor, Color? trackColor}) => + CakeScrollbarTheme( + thumbColor: thumbColor ?? this.thumbColor, + trackColor: trackColor ?? this.trackColor); + + @override + CakeScrollbarTheme lerp(ThemeExtension? other, double t) { + if (other is! CakeScrollbarTheme) { + return this; + } + + return CakeScrollbarTheme( + thumbColor: Color.lerp(thumbColor, other.thumbColor, t) ?? thumbColor, + trackColor: Color.lerp(trackColor, other.trackColor, t) ?? trackColor); + } +} diff --git a/lib/themes/extensions/cake_text_theme.dart b/lib/themes/extensions/cake_text_theme.dart new file mode 100644 index 000000000..31cd77e44 --- /dev/null +++ b/lib/themes/extensions/cake_text_theme.dart @@ -0,0 +1,65 @@ +import 'package:flutter/material.dart'; + +class CakeTextTheme extends ThemeExtension { + final Color secondaryTextColor; + final Color textfieldUnderlineColor; + final Color titleColor; + final Color addressButtonBorderColor; + final Color dateSectionRowColor; + final Color buttonTextColor; + final Color buttonSecondaryTextColor; + + CakeTextTheme( + {required this.secondaryTextColor, + required this.textfieldUnderlineColor, + required this.titleColor, + required this.addressButtonBorderColor, + required this.dateSectionRowColor, + Color? buttonTextColor, + Color? buttonSecondaryTextColor}) + : buttonTextColor = buttonTextColor ?? titleColor, + buttonSecondaryTextColor = + buttonSecondaryTextColor ?? secondaryTextColor; + + @override + CakeTextTheme copyWith( + {Color? secondaryTextColor, + Color? textfieldUnderlineColor, + Color? titleColor, + Color? addressButtonBorderColor, + Color? dateSectionRowColor, + Color? buttonTextColor, + Color? buttonSecondaryTextColor}) => + CakeTextTheme( + secondaryTextColor: secondaryTextColor ?? this.secondaryTextColor, + textfieldUnderlineColor: + textfieldUnderlineColor ?? this.textfieldUnderlineColor, + titleColor: titleColor ?? this.titleColor, + addressButtonBorderColor: + addressButtonBorderColor ?? this.addressButtonBorderColor, + dateSectionRowColor: dateSectionRowColor ?? this.dateSectionRowColor, + buttonTextColor: buttonTextColor ?? this.buttonTextColor, + buttonSecondaryTextColor: + buttonSecondaryTextColor ?? this.buttonSecondaryTextColor); + + @override + CakeTextTheme lerp(ThemeExtension? other, double t) { + if (other is! CakeTextTheme) { + return this; + } + + return CakeTextTheme( + secondaryTextColor: + Color.lerp(secondaryTextColor, other.secondaryTextColor, t)!, + textfieldUnderlineColor: Color.lerp( + textfieldUnderlineColor, other.textfieldUnderlineColor, t)!, + titleColor: Color.lerp(titleColor, other.titleColor, t)!, + addressButtonBorderColor: Color.lerp( + addressButtonBorderColor, other.addressButtonBorderColor, t)!, + dateSectionRowColor: + Color.lerp(dateSectionRowColor, other.dateSectionRowColor, t)!, + buttonTextColor: Color.lerp(buttonTextColor, other.buttonTextColor, t)!, + buttonSecondaryTextColor: Color.lerp( + buttonSecondaryTextColor, other.buttonSecondaryTextColor, t)!); + } +} diff --git a/lib/themes/extensions/dashboard_page_theme.dart b/lib/themes/extensions/dashboard_page_theme.dart new file mode 100644 index 000000000..8d0195e62 --- /dev/null +++ b/lib/themes/extensions/dashboard_page_theme.dart @@ -0,0 +1,79 @@ +import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart'; +import 'package:flutter/material.dart'; + +class DashboardPageTheme extends ThemeExtension { + final Color firstGradientBackgroundColor; + final Color secondGradientBackgroundColor; + final Color thirdGradientBackgroundColor; + final Color textColor; + final Color cardTextColor; + final Color pageTitleTextColor; + final Color mainActionsIconColor; + + final IndicatorDotTheme indicatorDotTheme; + + DashboardPageTheme( + {required this.firstGradientBackgroundColor, + required this.secondGradientBackgroundColor, + required this.thirdGradientBackgroundColor, + required this.textColor, + required this.indicatorDotTheme, + Color? mainActionsIconColor, + Color? pageTitleTextColor, + Color? cardTextColor}) + : pageTitleTextColor = pageTitleTextColor ?? textColor, + mainActionsIconColor = mainActionsIconColor ?? textColor, + cardTextColor = cardTextColor ?? textColor; + + @override + DashboardPageTheme copyWith( + {Color? firstGradientBackgroundColor, + Color? secondGradientBackgroundColor, + Color? thirdGradientBackgroundColor, + Color? textColor, + IndicatorDotTheme? indicatorDotTheme, + Color? pageTitleTextColor, + Color? mainActionsIconColor, + Color? cardTextColor}) => + DashboardPageTheme( + firstGradientBackgroundColor: + firstGradientBackgroundColor ?? this.firstGradientBackgroundColor, + secondGradientBackgroundColor: secondGradientBackgroundColor ?? + this.secondGradientBackgroundColor, + thirdGradientBackgroundColor: + thirdGradientBackgroundColor ?? this.thirdGradientBackgroundColor, + textColor: textColor ?? this.textColor, + indicatorDotTheme: indicatorDotTheme ?? this.indicatorDotTheme, + pageTitleTextColor: pageTitleTextColor ?? this.pageTitleTextColor, + mainActionsIconColor: + mainActionsIconColor ?? this.mainActionsIconColor, + cardTextColor: cardTextColor ?? this.cardTextColor); + + @override + DashboardPageTheme lerp(ThemeExtension? other, double t) { + if (other is! DashboardPageTheme) { + return this; + } + + return DashboardPageTheme( + firstGradientBackgroundColor: Color.lerp(firstGradientBackgroundColor, + other.firstGradientBackgroundColor, t) ?? + firstGradientBackgroundColor, + secondGradientBackgroundColor: Color.lerp(secondGradientBackgroundColor, + other.secondGradientBackgroundColor, t) ?? + secondGradientBackgroundColor, + thirdGradientBackgroundColor: Color.lerp(thirdGradientBackgroundColor, + other.thirdGradientBackgroundColor, t) ?? + thirdGradientBackgroundColor, + textColor: Color.lerp(textColor, other.textColor, t) ?? textColor, + indicatorDotTheme: indicatorDotTheme.lerp(other.indicatorDotTheme, t), + pageTitleTextColor: + Color.lerp(pageTitleTextColor, other.pageTitleTextColor, t) ?? + pageTitleTextColor, + mainActionsIconColor: + Color.lerp(mainActionsIconColor, other.mainActionsIconColor, t) ?? + mainActionsIconColor, + cardTextColor: + Color.lerp(cardTextColor, other.cardTextColor, t) ?? cardTextColor); + } +} diff --git a/lib/themes/extensions/exchange_page_theme.dart b/lib/themes/extensions/exchange_page_theme.dart new file mode 100644 index 000000000..9c35312a1 --- /dev/null +++ b/lib/themes/extensions/exchange_page_theme.dart @@ -0,0 +1,88 @@ +import 'package:flutter/material.dart'; + +class ExchangePageTheme extends ThemeExtension { + final Color hintTextColor; + final Color receiveAmountColor; + final Color firstGradientTopPanelColor; + final Color secondGradientTopPanelColor; + final Color firstGradientBottomPanelColor; + final Color secondGradientBottomPanelColor; + final Color textFieldBorderTopPanelColor; + final Color textFieldBorderBottomPanelColor; + final Color textFieldButtonColor; + final Color buttonBackgroundColor; + final Color qrCodeColor; + final Color dividerCodeColor; + + ExchangePageTheme( + {required this.hintTextColor, + required this.receiveAmountColor, + required this.firstGradientTopPanelColor, + required this.secondGradientTopPanelColor, + required this.firstGradientBottomPanelColor, + required this.secondGradientBottomPanelColor, + required this.textFieldBorderTopPanelColor, + required this.textFieldBorderBottomPanelColor, + required this.textFieldButtonColor, + required this.buttonBackgroundColor, + required this.qrCodeColor, + required this.dividerCodeColor}); + + @override + ExchangePageTheme copyWith({ + Color? hintTextColor, + Color? receiveAmountColor, + Color? firstGradientTopPanelColor, + Color? secondGradientTopPanelColor, + Color? firstGradientBottomPanelColor, + Color? secondGradientBottomPanelColor, + Color? textFieldBorderTopPanelColor, + Color? textFieldBorderBottomPanelColor, + Color? textFieldButtonColor, + Color? buttonBackgroundColor, + Color? qrCodeColor, + Color? dividerCodeColor, + }) => + ExchangePageTheme( + hintTextColor: hintTextColor ?? this.hintTextColor, + receiveAmountColor: receiveAmountColor ?? this.receiveAmountColor, + firstGradientTopPanelColor: + firstGradientTopPanelColor ?? this.firstGradientTopPanelColor, + secondGradientTopPanelColor: + secondGradientTopPanelColor ?? this.secondGradientTopPanelColor, + firstGradientBottomPanelColor: firstGradientBottomPanelColor ?? + this.firstGradientBottomPanelColor, + secondGradientBottomPanelColor: secondGradientBottomPanelColor ?? + this.secondGradientBottomPanelColor, + textFieldBorderTopPanelColor: + textFieldBorderTopPanelColor ?? this.textFieldBorderTopPanelColor, + textFieldBorderBottomPanelColor: textFieldBorderBottomPanelColor ?? + this.textFieldBorderBottomPanelColor, + textFieldButtonColor: + textFieldButtonColor ?? this.textFieldButtonColor, + buttonBackgroundColor: + buttonBackgroundColor ?? this.buttonBackgroundColor, + qrCodeColor: qrCodeColor ?? this.qrCodeColor, + dividerCodeColor: dividerCodeColor ?? this.dividerCodeColor); + + @override + ExchangePageTheme lerp(ThemeExtension? other, double t) { + if (other is! ExchangePageTheme) { + return this; + } + + return ExchangePageTheme( + hintTextColor: Color.lerp(hintTextColor, other.hintTextColor, t) ?? hintTextColor, + receiveAmountColor: Color.lerp(receiveAmountColor, other.receiveAmountColor, t) ?? receiveAmountColor, + firstGradientTopPanelColor: Color.lerp(firstGradientTopPanelColor, other.firstGradientTopPanelColor, t) ?? firstGradientTopPanelColor, + secondGradientTopPanelColor: Color.lerp(secondGradientTopPanelColor, other.secondGradientTopPanelColor, t) ?? secondGradientTopPanelColor, + firstGradientBottomPanelColor: Color.lerp(firstGradientBottomPanelColor, other.firstGradientBottomPanelColor, t) ?? firstGradientBottomPanelColor, + secondGradientBottomPanelColor: Color.lerp(secondGradientBottomPanelColor, other.secondGradientBottomPanelColor, t) ?? secondGradientBottomPanelColor, + textFieldBorderTopPanelColor: Color.lerp(textFieldBorderTopPanelColor, other.textFieldBorderTopPanelColor, t) ?? textFieldBorderTopPanelColor, + textFieldBorderBottomPanelColor: Color.lerp(textFieldBorderBottomPanelColor, other.textFieldBorderBottomPanelColor, t) ?? textFieldBorderBottomPanelColor, + textFieldButtonColor: Color.lerp(textFieldButtonColor, other.textFieldButtonColor, t) ?? textFieldButtonColor, + buttonBackgroundColor: Color.lerp(buttonBackgroundColor, other.buttonBackgroundColor, t) ?? buttonBackgroundColor, + qrCodeColor: Color.lerp(qrCodeColor, other.qrCodeColor, t) ?? qrCodeColor, + dividerCodeColor: Color.lerp(dividerCodeColor, other.dividerCodeColor, t) ?? dividerCodeColor); + } +} diff --git a/lib/themes/extensions/filter_theme.dart b/lib/themes/extensions/filter_theme.dart new file mode 100644 index 000000000..a2106f648 --- /dev/null +++ b/lib/themes/extensions/filter_theme.dart @@ -0,0 +1,68 @@ +import 'package:flutter/material.dart'; + +class FilterTheme extends ThemeExtension { + final Color checkboxFirstGradientColor; + final Color checkboxSecondGradientColor; + final Color checkboxBoundsColor; + final Color checkboxBackgroundColor; + final Color titlesColor; + final Color buttonColor; + final Color iconColor; + + FilterTheme( + {required this.checkboxFirstGradientColor, + required this.checkboxSecondGradientColor, + required this.checkboxBoundsColor, + required this.checkboxBackgroundColor, + required this.titlesColor, + required this.buttonColor, + required this.iconColor}); + + @override + FilterTheme copyWith({ + Color? checkboxFirstGradientColor, + Color? checkboxSecondGradientColor, + Color? checkboxBoundsColor, + Color? checkboxBackgroundColor, + Color? titlesColor, + Color? buttonColor, + Color? iconColor, + }) => + FilterTheme( + checkboxFirstGradientColor: + checkboxFirstGradientColor ?? this.checkboxFirstGradientColor, + checkboxSecondGradientColor: + checkboxSecondGradientColor ?? this.checkboxSecondGradientColor, + checkboxBoundsColor: checkboxBoundsColor ?? this.checkboxBoundsColor, + checkboxBackgroundColor: + checkboxBackgroundColor ?? this.checkboxBackgroundColor, + titlesColor: titlesColor ?? this.titlesColor, + buttonColor: buttonColor ?? this.buttonColor, + iconColor: iconColor ?? this.iconColor); + + @override + FilterTheme lerp(ThemeExtension? other, double t) { + if (other is! FilterTheme) { + return this; + } + + return FilterTheme( + checkboxFirstGradientColor: Color.lerp(checkboxFirstGradientColor, + other.checkboxFirstGradientColor, t) ?? + this.checkboxFirstGradientColor, + checkboxSecondGradientColor: Color.lerp(checkboxSecondGradientColor, + other.checkboxSecondGradientColor, t) ?? + this.checkboxSecondGradientColor, + checkboxBoundsColor: + Color.lerp(checkboxBoundsColor, other.checkboxBoundsColor, t) ?? + this.checkboxBoundsColor, + checkboxBackgroundColor: Color.lerp( + checkboxBackgroundColor, other.checkboxBackgroundColor, t) ?? + this.checkboxBackgroundColor, + titlesColor: + Color.lerp(titlesColor, other.titlesColor, t) ?? this.titlesColor, + buttonColor: + Color.lerp(buttonColor, other.buttonColor, t) ?? this.buttonColor, + iconColor: Color.lerp(iconColor, other.iconColor, t) ?? this.iconColor); + } +} diff --git a/lib/themes/extensions/indicator_dot_theme.dart b/lib/themes/extensions/indicator_dot_theme.dart new file mode 100644 index 000000000..f7f482ad6 --- /dev/null +++ b/lib/themes/extensions/indicator_dot_theme.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; + +class IndicatorDotTheme extends ThemeExtension { + final Color indicatorColor; + final Color activeIndicatorColor; + + IndicatorDotTheme( + {required this.indicatorColor, required this.activeIndicatorColor}); + + @override + IndicatorDotTheme copyWith( + {Color? indicatorColor, Color? actionButtonColor}) => + IndicatorDotTheme( + indicatorColor: indicatorColor ?? this.indicatorColor, + activeIndicatorColor: actionButtonColor ?? this.activeIndicatorColor); + + @override + IndicatorDotTheme lerp(ThemeExtension? other, double t) { + if (other is! IndicatorDotTheme) { + return this; + } + + return IndicatorDotTheme( + indicatorColor: Color.lerp(indicatorColor, other.indicatorColor, t) ?? + indicatorColor, + activeIndicatorColor: + Color.lerp(activeIndicatorColor, other.activeIndicatorColor, t) ?? + activeIndicatorColor); + } +} diff --git a/lib/themes/extensions/info_theme.dart b/lib/themes/extensions/info_theme.dart new file mode 100644 index 000000000..aaf9952ea --- /dev/null +++ b/lib/themes/extensions/info_theme.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; + +class InfoTheme extends ThemeExtension { + final Color textColor; + + InfoTheme({required this.textColor}); + + @override + InfoTheme copyWith({Color? textColor}) => + InfoTheme(textColor: textColor ?? this.textColor); + + @override + InfoTheme lerp(ThemeExtension? other, double t) { + if (other is! InfoTheme) { + return this; + } + + return InfoTheme( + textColor: Color.lerp(textColor, other.textColor, t) ?? textColor); + } +} diff --git a/lib/themes/extensions/keyboard_theme.dart b/lib/themes/extensions/keyboard_theme.dart new file mode 100644 index 000000000..316b7a370 --- /dev/null +++ b/lib/themes/extensions/keyboard_theme.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; + +class KeyboardTheme extends ThemeExtension { + final Color keyboardBarColor; + + KeyboardTheme({required this.keyboardBarColor}); + + @override + Object get type => KeyboardTheme; + + @override + KeyboardTheme copyWith({Color? keyboardBarColor}) => KeyboardTheme( + keyboardBarColor: keyboardBarColor ?? this.keyboardBarColor); + + @override + KeyboardTheme lerp(ThemeExtension? other, double t) { + if (other is! KeyboardTheme) { + return this; + } + + return KeyboardTheme( + keyboardBarColor: + Color.lerp(keyboardBarColor, other.keyboardBarColor, t) ?? + keyboardBarColor); + } +} diff --git a/lib/themes/extensions/menu_theme.dart b/lib/themes/extensions/menu_theme.dart new file mode 100644 index 000000000..e0a79dac2 --- /dev/null +++ b/lib/themes/extensions/menu_theme.dart @@ -0,0 +1,75 @@ +import 'package:flutter/material.dart'; + +class CakeMenuTheme extends ThemeExtension { + final Color headerFirstGradientColor; + final Color headerSecondGradientColor; + final Color subnameTextColor; + final Color dividerColor; + final Color backgroundColor; + final Color iconColor; + final Color settingActionsIconColor; + final Color settingTitleColor; + + CakeMenuTheme( + {required this.headerFirstGradientColor, + required this.headerSecondGradientColor, + required this.backgroundColor, + required this.subnameTextColor, + required this.dividerColor, + required this.iconColor, + required this.settingActionsIconColor, + required this.settingTitleColor}); + + @override + CakeMenuTheme copyWith( + {Color? headerFirstGradientColor, + Color? headerSecondGradientColor, + Color? backgroundColor, + Color? subnameTextColor, + Color? dividerColor, + Color? iconColor, + Color? settingActionsIconColor, + Color? settingTitleColor}) => + CakeMenuTheme( + headerFirstGradientColor: + headerFirstGradientColor ?? this.headerFirstGradientColor, + headerSecondGradientColor: + headerSecondGradientColor ?? this.headerSecondGradientColor, + backgroundColor: backgroundColor ?? this.backgroundColor, + subnameTextColor: subnameTextColor ?? this.subnameTextColor, + dividerColor: dividerColor ?? this.dividerColor, + iconColor: iconColor ?? this.iconColor, + settingActionsIconColor: + settingActionsIconColor ?? this.settingActionsIconColor, + settingTitleColor: settingTitleColor ?? this.settingTitleColor); + + @override + CakeMenuTheme lerp(ThemeExtension? other, double t) { + if (other is! CakeMenuTheme) { + return this; + } + + return CakeMenuTheme( + headerFirstGradientColor: Color.lerp( + headerFirstGradientColor, other.headerFirstGradientColor, t) ?? + headerFirstGradientColor, + headerSecondGradientColor: Color.lerp(headerSecondGradientColor, + other.headerSecondGradientColor, t) ?? + headerSecondGradientColor, + backgroundColor: + Color.lerp(backgroundColor, other.backgroundColor, t) ?? + backgroundColor, + subnameTextColor: + Color.lerp(subnameTextColor, other.subnameTextColor, t) ?? + subnameTextColor, + dividerColor: + Color.lerp(dividerColor, other.dividerColor, t) ?? dividerColor, + iconColor: Color.lerp(iconColor, other.iconColor, t) ?? iconColor, + settingActionsIconColor: Color.lerp( + settingActionsIconColor, other.settingActionsIconColor, t) ?? + settingActionsIconColor, + settingTitleColor: Color.lerp( + settingTitleColor, other.settingTitleColor, t) ?? + settingTitleColor); + } +} diff --git a/lib/themes/extensions/new_wallet_theme.dart b/lib/themes/extensions/new_wallet_theme.dart new file mode 100644 index 000000000..7e06818ff --- /dev/null +++ b/lib/themes/extensions/new_wallet_theme.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; + +class NewWalletTheme extends ThemeExtension { + final Color hintTextColor; + final Color underlineColor; + + NewWalletTheme({required this.hintTextColor, required this.underlineColor}); + + @override + Object get type => NewWalletTheme; + + @override + NewWalletTheme copyWith({Color? hintTextColor, Color? underlineColor}) => + NewWalletTheme( + hintTextColor: hintTextColor ?? this.hintTextColor, + underlineColor: underlineColor ?? this.underlineColor); + + @override + NewWalletTheme lerp(ThemeExtension? other, double t) { + if (other is! NewWalletTheme) { + return this; + } + + return NewWalletTheme( + hintTextColor: + Color.lerp(hintTextColor, other.hintTextColor, t) ?? hintTextColor, + underlineColor: Color.lerp(underlineColor, other.underlineColor, t) ?? + underlineColor); + } +} diff --git a/lib/themes/extensions/order_theme.dart b/lib/themes/extensions/order_theme.dart new file mode 100644 index 000000000..2c58fe477 --- /dev/null +++ b/lib/themes/extensions/order_theme.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; + +class OrderTheme extends ThemeExtension { + final Color iconColor; + + OrderTheme({required this.iconColor}); + + @override + OrderTheme copyWith({Color? iconColor}) => + OrderTheme(iconColor: iconColor ?? this.iconColor); + + @override + OrderTheme lerp(ThemeExtension? other, double t) { + if (other is! OrderTheme) { + return this; + } + + return OrderTheme( + iconColor: Color.lerp(iconColor, other.iconColor, t) ?? iconColor); + } +} diff --git a/lib/themes/extensions/picker_theme.dart b/lib/themes/extensions/picker_theme.dart new file mode 100644 index 000000000..afd2268ec --- /dev/null +++ b/lib/themes/extensions/picker_theme.dart @@ -0,0 +1,54 @@ +import 'package:flutter/material.dart'; + +class PickerTheme extends ThemeExtension { + final Color dividerColor; + final Color? searchIconColor; + final Color searchBackgroundFillColor; + final Color searchTextColor; + final Color? searchHintColor; + + PickerTheme( + {required this.dividerColor, + this.searchIconColor, + required this.searchBackgroundFillColor, + required this.searchTextColor, + this.searchHintColor}); + + @override + PickerTheme copyWith( + {Color? dividerColor, + Color? searchIconColor, + Color? searchBackgroundFillColor, + Color? searchTextColor, + Color? searchHintColor}) => + PickerTheme( + dividerColor: dividerColor ?? this.dividerColor, + searchIconColor: searchIconColor ?? this.searchIconColor, + searchBackgroundFillColor: + searchBackgroundFillColor ?? this.searchBackgroundFillColor, + searchTextColor: searchTextColor ?? this.searchTextColor, + searchHintColor: searchHintColor ?? this.searchHintColor); + + @override + PickerTheme lerp(ThemeExtension? other, double t) { + if (other is! PickerTheme) { + return this; + } + + return PickerTheme( + dividerColor: + Color.lerp(dividerColor, other.dividerColor, t) ?? dividerColor, + searchIconColor: + Color.lerp(searchIconColor, other.searchIconColor, t) ?? + searchIconColor, + searchBackgroundFillColor: Color.lerp(searchBackgroundFillColor, + other.searchBackgroundFillColor, t) ?? + searchBackgroundFillColor, + searchTextColor: + Color.lerp(searchTextColor, other.searchTextColor, t) ?? + searchTextColor, + searchHintColor: + Color.lerp(searchHintColor, other.searchHintColor, t) ?? + searchHintColor); + } +} diff --git a/lib/themes/extensions/pin_code_theme.dart b/lib/themes/extensions/pin_code_theme.dart new file mode 100644 index 000000000..e1b3f005f --- /dev/null +++ b/lib/themes/extensions/pin_code_theme.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; + +class PinCodeTheme extends ThemeExtension { + final Color indicatorsColor; + final Color switchColor; + + PinCodeTheme({required this.indicatorsColor, required this.switchColor}); + + @override + PinCodeTheme copyWith({Color? indicatorsColor, Color? switchColor}) => + PinCodeTheme( + indicatorsColor: indicatorsColor ?? this.indicatorsColor, + switchColor: switchColor ?? this.switchColor); + + @override + PinCodeTheme lerp(ThemeExtension? other, double t) { + if (other is! PinCodeTheme) { + return this; + } + + return PinCodeTheme( + indicatorsColor: + Color.lerp(indicatorsColor, other.indicatorsColor, t) ?? + indicatorsColor, + switchColor: + Color.lerp(switchColor, other.switchColor, t) ?? switchColor); + } +} diff --git a/lib/themes/extensions/placeholder_theme.dart b/lib/themes/extensions/placeholder_theme.dart new file mode 100644 index 000000000..14470a9c9 --- /dev/null +++ b/lib/themes/extensions/placeholder_theme.dart @@ -0,0 +1,20 @@ +import 'package:flutter/material.dart'; + +class PlaceholderTheme extends ThemeExtension { + final Color color; + + PlaceholderTheme({required this.color}); + + @override + PlaceholderTheme copyWith({Color? color}) => + PlaceholderTheme(color: color ?? this.color); + + @override + PlaceholderTheme lerp(ThemeExtension? other, double t) { + if (other is! PlaceholderTheme) { + return this; + } + + return PlaceholderTheme(color: Color.lerp(color, other.color, t) ?? color); + } +} diff --git a/lib/themes/extensions/qr_code_theme.dart b/lib/themes/extensions/qr_code_theme.dart new file mode 100644 index 000000000..7b6554553 --- /dev/null +++ b/lib/themes/extensions/qr_code_theme.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; + +class QRCodeTheme extends ThemeExtension { + final Color qrCodeColor; + final Color qrWidgetCopyButtonColor; + + QRCodeTheme( + {required this.qrCodeColor, required this.qrWidgetCopyButtonColor}); + + @override + QRCodeTheme copyWith({Color? qrCodeColor, Color? qrWidgetCopyButtonColor}) => + QRCodeTheme( + qrCodeColor: qrCodeColor ?? this.qrCodeColor, + qrWidgetCopyButtonColor: + qrWidgetCopyButtonColor ?? this.qrWidgetCopyButtonColor); + + @override + QRCodeTheme lerp(ThemeExtension? other, double t) { + if (other is! QRCodeTheme) { + return this; + } + + return QRCodeTheme( + qrCodeColor: Color.lerp(qrCodeColor, other.qrCodeColor, t)!, + qrWidgetCopyButtonColor: Color.lerp( + qrWidgetCopyButtonColor, other.qrWidgetCopyButtonColor, t)!); + } +} diff --git a/lib/themes/extensions/receive_page_theme.dart b/lib/themes/extensions/receive_page_theme.dart new file mode 100644 index 000000000..0974598d9 --- /dev/null +++ b/lib/themes/extensions/receive_page_theme.dart @@ -0,0 +1,70 @@ +import 'package:flutter/material.dart'; + +class ReceivePageTheme extends ThemeExtension { + final Color currentTileBackgroundColor; + final Color currentTileTextColor; + final Color tilesBackgroundColor; + final Color tilesTextColor; + final Color iconsBackgroundColor; + final Color iconsColor; + final Color amountBottomBorderColor; + final Color amountHintTextColor; + + ReceivePageTheme( + {required this.currentTileBackgroundColor, + required this.currentTileTextColor, + required this.tilesBackgroundColor, + required this.tilesTextColor, + required this.iconsBackgroundColor, + required this.iconsColor, + required this.amountBottomBorderColor, + required this.amountHintTextColor}); + + @override + ReceivePageTheme copyWith( + {Color? currentTileBackgroundColor, + Color? currentTileTextColor, + Color? tilesBackgroundColor, + Color? tilesTextColor, + Color? iconsBackgroundColor, + Color? iconsColor, + Color? amountBottomBorderColor, + Color? amountHintTextColor}) => + ReceivePageTheme( + currentTileBackgroundColor: + currentTileBackgroundColor ?? this.currentTileBackgroundColor, + currentTileTextColor: + currentTileTextColor ?? this.currentTileTextColor, + tilesBackgroundColor: + tilesBackgroundColor ?? this.tilesBackgroundColor, + tilesTextColor: tilesTextColor ?? this.tilesTextColor, + iconsBackgroundColor: + iconsBackgroundColor ?? this.iconsBackgroundColor, + iconsColor: iconsColor ?? this.iconsColor, + amountBottomBorderColor: + amountBottomBorderColor ?? this.amountBottomBorderColor, + amountHintTextColor: amountHintTextColor ?? this.amountHintTextColor); + + @override + ReceivePageTheme lerp(ThemeExtension? other, double t) { + if (other is! ReceivePageTheme) { + return this; + } + + return ReceivePageTheme( + currentTileBackgroundColor: Color.lerp( + currentTileBackgroundColor, other.currentTileBackgroundColor, t)!, + currentTileTextColor: + Color.lerp(currentTileTextColor, other.currentTileTextColor, t)!, + tilesBackgroundColor: + Color.lerp(tilesBackgroundColor, other.tilesBackgroundColor, t)!, + tilesTextColor: Color.lerp(tilesTextColor, other.tilesTextColor, t)!, + iconsBackgroundColor: + Color.lerp(iconsBackgroundColor, other.iconsBackgroundColor, t)!, + iconsColor: Color.lerp(iconsColor, other.iconsColor, t)!, + amountBottomBorderColor: Color.lerp( + amountBottomBorderColor, other.amountBottomBorderColor, t)!, + amountHintTextColor: + Color.lerp(amountHintTextColor, other.amountHintTextColor, t)!); + } +} diff --git a/lib/themes/extensions/seed_widget_theme.dart b/lib/themes/extensions/seed_widget_theme.dart new file mode 100644 index 000000000..9ac20db55 --- /dev/null +++ b/lib/themes/extensions/seed_widget_theme.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; + +class SeedWidgetTheme extends ThemeExtension { + final Color hintTextColor; + + SeedWidgetTheme({required this.hintTextColor}); + + @override + SeedWidgetTheme copyWith({Color? hintTextColor}) => + SeedWidgetTheme(hintTextColor: hintTextColor ?? this.hintTextColor); + + @override + SeedWidgetTheme lerp(ThemeExtension? other, double t) { + if (other is! SeedWidgetTheme) { + return this; + } + + return SeedWidgetTheme( + hintTextColor: + Color.lerp(hintTextColor, other.hintTextColor, t) ?? hintTextColor); + } +} diff --git a/lib/themes/extensions/send_page_theme.dart b/lib/themes/extensions/send_page_theme.dart new file mode 100644 index 000000000..79aca77f9 --- /dev/null +++ b/lib/themes/extensions/send_page_theme.dart @@ -0,0 +1,117 @@ +import 'package:flutter/material.dart'; + +class SendPageTheme extends ThemeExtension { + final Color templateTitleColor; + final Color templateBackgroundColor; + final Color templateNewTextColor; + final Color templateSelectedCurrencyBackgroundColor; + final Color templateSelectedCurrencyTitleColor; + final Color templateDottedBorderColor; + final Color estimatedFeeColor; + final Color textFieldButtonIconColor; + final Color textFieldButtonColor; + final Color textFieldHintColor; + final Color textFieldBorderColor; + final Color firstGradientColor; + final Color secondGradientColor; + final Color indicatorDotColor; + + SendPageTheme( + {required this.templateTitleColor, + required this.templateBackgroundColor, + required this.templateNewTextColor, + required this.templateSelectedCurrencyBackgroundColor, + required this.templateSelectedCurrencyTitleColor, + required this.templateDottedBorderColor, + required this.estimatedFeeColor, + required this.textFieldButtonIconColor, + required this.textFieldButtonColor, + required this.textFieldHintColor, + required this.textFieldBorderColor, + required this.firstGradientColor, + required this.secondGradientColor, + required this.indicatorDotColor}); + + @override + SendPageTheme copyWith( + {Color? templateTitleColor, + Color? templateBackgroundColor, + Color? templateNewTextColor, + Color? templateSelectedCurrencyBackgroundColor, + Color? templateSelectedCurrencyTitleColor, + Color? templateDottedBorderColor, + Color? estimatedFeeColor, + Color? textFieldButtonIconColor, + Color? textFieldButtonColor, + Color? textFieldHintColor, + Color? textFieldBorderColor, + Color? firstGradientColor, + Color? secondGradientColor, + Color? indicatorDotColor}) => + SendPageTheme( + templateTitleColor: templateTitleColor ?? this.templateTitleColor, + templateBackgroundColor: + templateBackgroundColor ?? this.templateBackgroundColor, + templateNewTextColor: + templateNewTextColor ?? this.templateNewTextColor, + templateSelectedCurrencyBackgroundColor: + templateSelectedCurrencyBackgroundColor ?? + this.templateSelectedCurrencyBackgroundColor, + templateSelectedCurrencyTitleColor: + templateSelectedCurrencyTitleColor ?? + this.templateSelectedCurrencyTitleColor, + templateDottedBorderColor: + templateDottedBorderColor ?? this.templateDottedBorderColor, + estimatedFeeColor: estimatedFeeColor ?? this.estimatedFeeColor, + textFieldButtonIconColor: + textFieldButtonIconColor ?? this.textFieldButtonIconColor, + textFieldButtonColor: + textFieldButtonColor ?? this.textFieldButtonColor, + textFieldHintColor: textFieldHintColor ?? this.textFieldHintColor, + textFieldBorderColor: + textFieldBorderColor ?? this.textFieldBorderColor, + firstGradientColor: firstGradientColor ?? this.firstGradientColor, + secondGradientColor: secondGradientColor ?? this.secondGradientColor, + indicatorDotColor: indicatorDotColor ?? this.indicatorDotColor); + + @override + SendPageTheme lerp(ThemeExtension? other, double t) { + if (other is! SendPageTheme) { + return this; + } + + return SendPageTheme( + templateTitleColor: + Color.lerp(templateTitleColor, other.templateTitleColor, t)!, + templateBackgroundColor: Color.lerp( + templateBackgroundColor, other.templateBackgroundColor, t)!, + templateNewTextColor: + Color.lerp(templateNewTextColor, other.templateNewTextColor, t)!, + templateSelectedCurrencyBackgroundColor: Color.lerp( + templateSelectedCurrencyBackgroundColor, + other.templateSelectedCurrencyBackgroundColor, + t)!, + templateSelectedCurrencyTitleColor: Color.lerp( + templateSelectedCurrencyTitleColor, + other.templateSelectedCurrencyTitleColor, + t)!, + templateDottedBorderColor: Color.lerp( + templateDottedBorderColor, other.templateDottedBorderColor, t)!, + estimatedFeeColor: + Color.lerp(estimatedFeeColor, other.estimatedFeeColor, t)!, + textFieldButtonIconColor: Color.lerp( + textFieldButtonIconColor, other.textFieldButtonIconColor, t)!, + textFieldButtonColor: + Color.lerp(textFieldButtonColor, other.textFieldButtonColor, t)!, + textFieldHintColor: + Color.lerp(textFieldHintColor, other.textFieldHintColor, t)!, + textFieldBorderColor: + Color.lerp(textFieldBorderColor, other.textFieldBorderColor, t)!, + firstGradientColor: + Color.lerp(firstGradientColor, other.firstGradientColor, t)!, + secondGradientColor: + Color.lerp(secondGradientColor, other.secondGradientColor, t)!, + indicatorDotColor: + Color.lerp(indicatorDotColor, other.indicatorDotColor, t)!); + } +} diff --git a/lib/themes/extensions/support_page_theme.dart b/lib/themes/extensions/support_page_theme.dart new file mode 100644 index 000000000..1b4a4117c --- /dev/null +++ b/lib/themes/extensions/support_page_theme.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; + +class SupportPageTheme extends ThemeExtension { + final Color iconColor; + + SupportPageTheme({required this.iconColor}); + + @override + SupportPageTheme copyWith({Color? iconColor}) => + SupportPageTheme(iconColor: iconColor ?? this.iconColor); + + @override + SupportPageTheme lerp(ThemeExtension? other, double t) { + if (other is! SupportPageTheme) { + return this; + } + + return SupportPageTheme( + iconColor: Color.lerp(iconColor, other.iconColor, t) ?? iconColor); + } +} diff --git a/lib/themes/extensions/sync_indicator_theme.dart b/lib/themes/extensions/sync_indicator_theme.dart new file mode 100644 index 000000000..b523a646a --- /dev/null +++ b/lib/themes/extensions/sync_indicator_theme.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; + +class SyncIndicatorTheme extends ThemeExtension { + final Color textColor; + final Color syncedBackgroundColor; + final Color notSyncedIconColor; + final Color notSyncedBackgroundColor; + + SyncIndicatorTheme( + {required this.textColor, + required this.syncedBackgroundColor, + required this.notSyncedIconColor, + required this.notSyncedBackgroundColor}); + + @override + SyncIndicatorTheme copyWith({ + Color? textColor, + Color? syncedBackgroundColor, + Color? notSyncedIconColor, + Color? notSyncedBackgroundColor, + }) => + SyncIndicatorTheme( + textColor: textColor ?? this.textColor, + syncedBackgroundColor: + syncedBackgroundColor ?? this.syncedBackgroundColor, + notSyncedIconColor: notSyncedIconColor ?? this.notSyncedIconColor, + notSyncedBackgroundColor: + notSyncedBackgroundColor ?? this.notSyncedBackgroundColor); + + @override + SyncIndicatorTheme lerp(ThemeExtension? other, double t) { + if (other is! SyncIndicatorTheme) { + return this; + } + + return SyncIndicatorTheme( + textColor: Color.lerp(textColor, other.textColor, t) ?? textColor, + syncedBackgroundColor: + Color.lerp(syncedBackgroundColor, other.syncedBackgroundColor, t) ?? + syncedBackgroundColor, + notSyncedIconColor: + Color.lerp(notSyncedIconColor, other.notSyncedIconColor, t) ?? + notSyncedIconColor, + notSyncedBackgroundColor: Color.lerp( + notSyncedBackgroundColor, other.notSyncedBackgroundColor, t) ?? + notSyncedBackgroundColor); + } +} diff --git a/lib/themes/extensions/transaction_trade_theme.dart b/lib/themes/extensions/transaction_trade_theme.dart new file mode 100644 index 000000000..d912a8850 --- /dev/null +++ b/lib/themes/extensions/transaction_trade_theme.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; + +class TransactionTradeTheme extends ThemeExtension { + final Color detailsTitlesColor; + final Color rowsColor; + + TransactionTradeTheme( + {required this.detailsTitlesColor, required this.rowsColor}); + + @override + TransactionTradeTheme copyWith( + {Color? detailsTitlesColor, Color? rowsColor}) => + TransactionTradeTheme( + detailsTitlesColor: detailsTitlesColor ?? this.detailsTitlesColor, + rowsColor: rowsColor ?? this.rowsColor); + + @override + TransactionTradeTheme lerp( + ThemeExtension? other, double t) { + if (other is! TransactionTradeTheme) { + return this; + } + + return TransactionTradeTheme( + detailsTitlesColor: + Color.lerp(detailsTitlesColor, other.detailsTitlesColor, t)!, + rowsColor: Color.lerp(rowsColor, other.rowsColor, t)!); + } +} diff --git a/lib/themes/extensions/wallet_list_theme.dart b/lib/themes/extensions/wallet_list_theme.dart new file mode 100644 index 000000000..aac3a193a --- /dev/null +++ b/lib/themes/extensions/wallet_list_theme.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; + +class WalletListTheme extends ThemeExtension { + final Color restoreWalletButtonTextColor; + final Color createNewWalletButtonBackgroundColor; + + WalletListTheme( + {required this.restoreWalletButtonTextColor, + required this.createNewWalletButtonBackgroundColor}); + + @override + WalletListTheme copyWith( + {Color? restoreWalletButtonTextColor, + Color? createNewWalletButtonBackgroundColor}) => + WalletListTheme( + restoreWalletButtonTextColor: + restoreWalletButtonTextColor ?? this.restoreWalletButtonTextColor, + createNewWalletButtonBackgroundColor: + createNewWalletButtonBackgroundColor ?? + this.createNewWalletButtonBackgroundColor); + + @override + WalletListTheme lerp(ThemeExtension? other, double t) { + if (other is! WalletListTheme) { + return this; + } + + return WalletListTheme( + restoreWalletButtonTextColor: Color.lerp(restoreWalletButtonTextColor, + other.restoreWalletButtonTextColor, t) ?? + restoreWalletButtonTextColor, + createNewWalletButtonBackgroundColor: Color.lerp( + createNewWalletButtonBackgroundColor, + other.createNewWalletButtonBackgroundColor, + t) ?? + createNewWalletButtonBackgroundColor); + } +} diff --git a/lib/themes/high_contrast_theme.dart b/lib/themes/high_contrast_theme.dart new file mode 100644 index 000000000..e43e63020 --- /dev/null +++ b/lib/themes/high_contrast_theme.dart @@ -0,0 +1,118 @@ +import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/extensions/account_list_theme.dart'; +import 'package:cake_wallet/themes/extensions/address_theme.dart'; +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; +import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; +import 'package:cake_wallet/themes/extensions/picker_theme.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; +import 'package:cake_wallet/themes/monero_light_theme.dart'; +import 'package:flutter/material.dart'; + +class HighContrastTheme extends MoneroLightTheme { + HighContrastTheme({required int raw}) : super(raw: raw) { + colorScheme = ColorScheme.fromSwatch( + primarySwatch: Colors.grey, + accentColor: primaryColor, + backgroundColor: Colors.white, + cardColor: containerColor, + brightness: Brightness.light); + } + + @override + String get title => S.current.high_contrast_theme; + @override + Color get primaryColor => Colors.black; + @override + Color get containerColor => Palette.highContrastGray; + @override + Color get primaryTextColor => colorScheme.onBackground; + @override + Color get dialogBackgroundColor => Colors.white; + + @override + CakeTextTheme get cakeTextTheme => super.cakeTextTheme.copyWith( + buttonTextColor: Colors.white, + buttonSecondaryTextColor: Colors.white.withOpacity(0.5)); + + @override + SyncIndicatorTheme get syncIndicatorStyle => + super.syncIndicatorStyle.copyWith( + textColor: colorScheme.background, + syncedBackgroundColor: containerColor); + + @override + BalancePageTheme get balancePageTheme => super.balancePageTheme.copyWith( + textColor: Colors.white, + labelTextColor: Colors.grey, + assetTitleColor: Colors.white, + balanceAmountColor: Colors.white); + + @override + DashboardPageTheme get dashboardPageTheme => + super.dashboardPageTheme.copyWith( + textColor: Colors.black, + cardTextColor: Colors.white, + mainActionsIconColor: Colors.white, + indicatorDotTheme: IndicatorDotTheme( + indicatorColor: Colors.grey, activeIndicatorColor: Colors.black)); + + @override + ExchangePageTheme get exchangePageTheme => super + .exchangePageTheme + .copyWith(firstGradientTopPanelColor: containerColor); + + @override + SendPageTheme get sendPageTheme => super.sendPageTheme.copyWith( + templateTitleColor: Colors.white, + templateBackgroundColor: Colors.black, + firstGradientColor: containerColor); + + @override + AddressTheme get addressTheme => + super.addressTheme.copyWith(actionButtonColor: Colors.grey); + + @override + FilterTheme get filterTheme => + super.filterTheme.copyWith(iconColor: Colors.white); + + @override + CakeMenuTheme get menuTheme => super.menuTheme.copyWith( + settingTitleColor: Colors.black, + headerFirstGradientColor: containerColor, + iconColor: Colors.white); + + @override + PickerTheme get pickerTheme => super.pickerTheme.copyWith( + searchIconColor: Colors.white, + searchHintColor: Colors.white, + searchTextColor: Colors.white, + searchBackgroundFillColor: Colors.grey); + + @override + AccountListTheme get accountListTheme => super.accountListTheme.copyWith( + tilesTextColor: Colors.black, + tilesBackgroundColor: Colors.white, + currentAccountBackgroundColor: containerColor, + currentAccountTextColor: Colors.white, + currentAccountAmountColor: Colors.white); + + @override + ReceivePageTheme get receivePageTheme => super.receivePageTheme.copyWith( + tilesTextColor: Colors.white, + iconsBackgroundColor: Colors.grey, + iconsColor: Colors.black); + + @override + ThemeData get themeData => super.themeData.copyWith( + disabledColor: Colors.grey, + dialogTheme: + super.themeData.dialogTheme.copyWith(backgroundColor: Colors.white)); +} diff --git a/lib/themes/light_theme.dart b/lib/themes/light_theme.dart index ad572c13f..f24551e66 100644 --- a/lib/themes/light_theme.dart +++ b/lib/themes/light_theme.dart @@ -1,3 +1,29 @@ +import 'package:cake_wallet/themes/extensions/account_list_theme.dart'; +import 'package:cake_wallet/themes/extensions/address_theme.dart'; +import 'package:cake_wallet/themes/extensions/alert_theme.dart'; +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; +import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart'; +import 'package:cake_wallet/themes/extensions/info_theme.dart'; +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; +import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; +import 'package:cake_wallet/themes/extensions/order_theme.dart'; +import 'package:cake_wallet/themes/extensions/picker_theme.dart'; +import 'package:cake_wallet/themes/extensions/pin_code_theme.dart'; +import 'package:cake_wallet/themes/extensions/placeholder_theme.dart'; +import 'package:cake_wallet/themes/extensions/qr_code_theme.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/support_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; +import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/palette.dart'; @@ -8,268 +34,192 @@ class LightTheme extends ThemeBase { @override String get title => S.current.light_theme; - @override ThemeType get type => ThemeType.light; - - ThemeData theme = ThemeData( - fontFamily: 'Lato', - brightness: Brightness.light, - scaffoldBackgroundColor: Colors.white, // second gradient color - primaryColor: Colors.white, // third gradient color - indicatorColor: - PaletteDark.darkCyanBlue.withOpacity(0.67), // page indicator - hoverColor: Palette.darkBlueCraiola, // amount hint text (receive page) - dividerColor: Palette.paleBlue, - hintColor: Palette.gray, - textTheme: TextTheme( - // title -> titleLarge - titleLarge: TextStyle( - color: Palette.darkBlueCraiola, // sync_indicator text - backgroundColor: Palette.blueAlice, // synced sync_indicator - decorationColor: Palette.blueAlice.withOpacity(0.75), // not synced sync_indicator - ), - bodySmall: TextStyle( - color: Palette.shineOrange, // not synced light - decorationColor: PaletteDark.wildBlue, // filter icon - ), - labelSmall: TextStyle( - color: Palette.blueAlice, // filter button - backgroundColor: PaletteDark.darkCyanBlue, // date section row - decorationColor: - Palette.blueAlice // icons (transaction and trade rows) - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: Palette.blueAlice, // address button border - decorationColor: PaletteDark.lightBlueGrey, // copy button (qr widget) - ), - // headline -> headlineSmall - headlineSmall: TextStyle( - color: Colors.white, // qr code - decorationColor: Palette.darkBlueCraiola, // bottom border of amount (receive page) - ), - // display1 -> headlineMedium - headlineMedium: TextStyle( - color: PaletteDark.lightBlueGrey, // icons color (receive page) - decorationColor: Palette.moderateLavender, // icons background (receive page) - ), - // display2 -> headldisplaySmalline3 - displaySmall: TextStyle( - color: - Palette.darkBlueCraiola, // text color of tiles (receive page) - decorationColor: - Palette.blueAlice // background of tiles (receive page) - ), - // display3 -> displayMedium - displayMedium: TextStyle( - color: Colors.white, // text color of current tile (receive page), - //decorationColor: Palette.blueCraiola // background of current tile (receive page) - decorationColor: Palette - .blueCraiola // background of current tile (receive page) - ), - // display4 -> displayLarge - displayLarge: TextStyle( - color: Palette.violetBlue, // text color of tiles (account list) - decorationColor: - Colors.white // background of tiles (account list) - ), - // subtitle -> titleSmall - titleSmall: TextStyle( - color: Palette - .protectiveBlue, // text color of current tile (account list) - decorationColor: - Colors.white // background of current tile (account list) - ), - // body -> bodyMedium - bodyMedium: TextStyle( - color: Palette.moderatePurpleBlue, // scrollbar thumb - decorationColor: Palette.periwinkleCraiola // scrollbar background - ), - // body2 -> bodyLarge - bodyLarge: TextStyle( - color: Palette.moderateLavender, // menu header - decorationColor: Colors.white, // menu background - ) - ), - scrollbarTheme: ScrollbarThemeData( - thumbColor: MaterialStateProperty.all(Palette.moderatePurpleBlue), - trackColor: MaterialStateProperty.all(Palette.periwinkleCraiola), - radius: Radius.circular(3), - thickness: MaterialStateProperty.all(6), - thumbVisibility: MaterialStateProperty.all(true), - crossAxisMargin: 6, - ), - primaryTextTheme: TextTheme( - // title -> titleLarge - titleLarge: TextStyle( - color: Palette.darkBlueCraiola, // title color - backgroundColor: Palette.wildPeriwinkle // textfield underline - ), - bodySmall: TextStyle( - color: PaletteDark.pigeonBlue, // secondary text - decorationColor: Palette.wildLavender // menu divider - ), - labelSmall: TextStyle( - color: Palette.darkGray, // transaction/trade details titles - decorationColor: PaletteDark.darkCyanBlue, // placeholder - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: Palette.blueCraiola, // first gradient color (send page) - decorationColor: - Palette.blueGreyCraiola // second gradient color (send page) - ), - // headline -> headlineSmall - headlineSmall: TextStyle( - color: Colors.white - .withOpacity(0.5), // text field border color (send page) - decorationColor: Colors.white - .withOpacity(0.5), // text field hint color (send page) - ), - // display1 -> headlineMedium - headlineMedium: TextStyle( - color: Colors.white - .withOpacity(0.2), // text field button color (send page) - decorationColor: - Colors.white // text field button icon color (send page) - ), - // display2 -> displaySmall - displaySmall: TextStyle( - color: Colors.white.withOpacity(0.5), // estimated fee (send page) - backgroundColor: PaletteDark.darkCyanBlue - .withOpacity(0.67), // dot color for indicator on send page - decorationColor: - Palette.moderateLavender // template dotted border (send page) - ), - // display3 -> displayMedium - displayMedium: TextStyle( - color: Palette.darkBlueCraiola, // template new text (send page) - backgroundColor: PaletteDark - .darkNightBlue, // active dot color for indicator on send page - decorationColor: - Palette.blueAlice // template background color (send page) - ), - // display4 -> displayLarge - displayLarge: TextStyle( - color: Palette.darkBlueCraiola, // template title (send page) - backgroundColor: - Colors.black, // icon color on order row (moonpay) - decorationColor: - Palette.niagara // receive amount text (exchange page) - ), - // subtitle -> titleSmall - titleSmall: TextStyle( - color: Palette - .blueCraiola, // first gradient color top panel (exchange page) - decorationColor: Palette - .blueGreyCraiola // second gradient color top panel (exchange page) - ), - // body -> bodyMedium - bodyMedium: TextStyle( - color: Palette.blueCraiola.withOpacity( - 0.7), // first gradient color bottom panel (exchange page) - decorationColor: Palette.blueGreyCraiola.withOpacity( - 0.7), // second gradient color bottom panel (exchange page) - backgroundColor: Palette.protectiveBlue // alert right button text - ), - // body2 -> bodyLarge - bodyLarge: TextStyle( - color: Colors.white.withOpacity( - 0.5), // text field border on top panel (exchange page) - decorationColor: Colors.white.withOpacity( - 0.5), // text field border on bottom panel (exchange page) - backgroundColor: Palette.brightOrange // alert left button text - ) - ), - focusColor: Colors.white.withOpacity(0.2), // text field button (exchange page) - accentTextTheme: TextTheme( - // title -> headlititleLargene6 - titleLarge: TextStyle( - color: Colors.white, // picker background - backgroundColor: Palette.periwinkleCraiola, // picker divider - decorationColor: Colors.white // dialog background - ), - bodySmall: TextStyle( - color: Palette.blueAlice, // container (confirm exchange) - backgroundColor: Palette.blueAlice, // button background (confirm exchange) - decorationColor: Palette.darkBlueCraiola, // text color (information page) - ), - // subtitle -> titleSmall - titleSmall: TextStyle( - color: Palette.darkBlueCraiola, // QR code (exchange trade page) - backgroundColor: - Palette.wildPeriwinkle, // divider (exchange trade page) - decorationColor: Palette - .protectiveBlue // crete new wallet button background (wallet list page) - ), - // headline -> headlineSmall - headlineSmall: TextStyle( - color: Palette - .moderateLavender, // first gradient color of wallet action buttons (wallet list page) - backgroundColor: Palette - .moderateLavender, // second gradient color of wallet action buttons (wallet list page) - decorationColor: Colors - .white // restore wallet button text color (wallet list page) - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: Palette.darkGray, // titles color (filter widget) - backgroundColor: Palette.periwinkle, // divider color (filter widget) - decorationColor: Colors.white // checkbox background (filter widget) - ), - labelSmall: TextStyle( - color: Palette.wildPeriwinkle, // checkbox bounds (filter widget) - decorationColor: Colors.white, // menu subname - ), - // display1 -> headlineMedium - headlineMedium: TextStyle( - color: Palette.blueCraiola, // first gradient color (menu header) - decorationColor: Palette.blueGreyCraiola, // second gradient color(menu header) - backgroundColor: PaletteDark.darkNightBlue // active dot color - ), - // display2 -> displaySmall - displaySmall: TextStyle( - color: - Palette.shadowWhite, // action button color (address text field) - decorationColor: Palette.darkGray, // hint text (seed widget) - backgroundColor: Palette.darkBlueCraiola - .withOpacity(0.67) // text on balance page - ), - // display3 -> displayMedium - displayMedium: TextStyle( - color: Palette.darkGray, // hint text (new wallet page) - decorationColor: - Palette.periwinkleCraiola, // underline (new wallet page) - backgroundColor: - Palette.darkBlueCraiola // menu, icons, balance (dashboard page) - ), - // display4 -> displayLarge - displayLarge: TextStyle( - color: Palette.darkGray, // switch background (settings page) - backgroundColor: - Colors.black, // icon color on support page (moonpay, github) - decorationColor: - Colors.white.withOpacity(0.4) // hint text (exchange page) - ), - // body -> bodyMedium - bodyMedium: TextStyle( - color: Palette.darkGray, // indicators (PIN code) - decorationColor: Palette.darkGray, // switch (PIN code) - backgroundColor: Colors.white // alert right button - ), - // body2 -> bodyLarge - bodyLarge: TextStyle( - color: Palette.protectiveBlue, // primary buttons - decorationColor: Colors.white, // alert left button, - backgroundColor: Palette.dullGray // keyboard bar color - ), - ), - cardColor: Palette.protectiveBlue // bottom button (action list) - ); + @override + Brightness get brightness => Brightness.light; + @override + Color get backgroundColor => Colors.white; + @override + Color get primaryColor => Palette.protectiveBlue; + @override + Color get primaryTextColor => Palette.darkBlueCraiola; + @override + Color get containerColor => Palette.blueAlice; + @override + Color get dialogBackgroundColor => Colors.white; @override - ThemeData get themeData => theme.copyWith( - colorScheme: theme.colorScheme - .copyWith(background: Colors.white, secondary: Colors.white)); + CakeScrollbarTheme get scrollbarTheme => CakeScrollbarTheme( + thumbColor: Palette.moderatePurpleBlue, + trackColor: Palette.periwinkleCraiola); + + @override + SyncIndicatorTheme get syncIndicatorStyle => SyncIndicatorTheme( + textColor: Palette.darkBlueCraiola, + syncedBackgroundColor: Palette.blueAlice, + notSyncedIconColor: Palette.shineOrange, + notSyncedBackgroundColor: Palette.blueAlice.withOpacity(0.75)); + + @override + KeyboardTheme get keyboardTheme => + KeyboardTheme(keyboardBarColor: Palette.dullGray); + + @override + PinCodeTheme get pinCodeTheme => PinCodeTheme( + indicatorsColor: Palette.darkGray, switchColor: Palette.darkGray); + + @override + SupportPageTheme get supportPageTheme => + SupportPageTheme(iconColor: Colors.black); + + @override + ExchangePageTheme get exchangePageTheme => ExchangePageTheme( + hintTextColor: Colors.white.withOpacity(0.4), + dividerCodeColor: Palette.wildPeriwinkle, + qrCodeColor: primaryTextColor, + buttonBackgroundColor: containerColor, + textFieldButtonColor: Colors.white.withOpacity(0.2), + textFieldBorderBottomPanelColor: Colors.white.withOpacity(0.5), + textFieldBorderTopPanelColor: Colors.white.withOpacity(0.5), + secondGradientBottomPanelColor: Palette.blueGreyCraiola.withOpacity(0.7), + firstGradientBottomPanelColor: Palette.blueCraiola.withOpacity(0.7), + secondGradientTopPanelColor: Palette.blueGreyCraiola, + firstGradientTopPanelColor: Palette.blueCraiola, + receiveAmountColor: Palette.niagara); + + @override + NewWalletTheme get newWalletTheme => NewWalletTheme( + hintTextColor: Palette.darkGray, + underlineColor: Palette.periwinkleCraiola); + + @override + AddressTheme get addressTheme => + AddressTheme(actionButtonColor: Palette.shadowWhite); + + @override + DashboardPageTheme get dashboardPageTheme => + super.dashboardPageTheme.copyWith( + cardTextColor: super.dashboardPageTheme.textColor, + indicatorDotTheme: IndicatorDotTheme( + indicatorColor: PaletteDark.darkCyanBlue.withOpacity(0.67), + activeIndicatorColor: PaletteDark.darkNightBlue)); + + @override + BalancePageTheme get balancePageTheme => BalancePageTheme( + textColor: dashboardPageTheme.textColor, + labelTextColor: Palette.darkBlueCraiola.withOpacity(0.67)); + + @override + CakeMenuTheme get menuTheme => CakeMenuTheme( + headerFirstGradientColor: Palette.blueCraiola, + headerSecondGradientColor: Palette.blueGreyCraiola, + backgroundColor: Colors.white, + subnameTextColor: Colors.white, + dividerColor: Palette.wildLavender, + iconColor: Colors.white, + settingTitleColor: receivePageTheme.tilesTextColor, + settingActionsIconColor: Palette.gray); + + @override + FilterTheme get filterTheme => FilterTheme( + checkboxFirstGradientColor: Palette.blueCraiola, + checkboxSecondGradientColor: Palette.blueGreyCraiola, + checkboxBoundsColor: Palette.wildPeriwinkle, + checkboxBackgroundColor: Colors.white, + titlesColor: Palette.darkGray, + buttonColor: Palette.blueAlice, + iconColor: PaletteDark.wildBlue); + + @override + WalletListTheme get walletListTheme => WalletListTheme( + restoreWalletButtonTextColor: Colors.white, + createNewWalletButtonBackgroundColor: Palette.protectiveBlue); + + @override + InfoTheme get infoTheme => InfoTheme(textColor: Palette.darkBlueCraiola); + + @override + PickerTheme get pickerTheme => PickerTheme( + dividerColor: Palette.periwinkleCraiola, + searchTextColor: cakeTextTheme.textfieldUnderlineColor, + searchBackgroundFillColor: addressTheme.actionButtonColor); + + @override + AlertTheme get alertTheme => AlertTheme( + backdropColor: PaletteDark.darkNightBlue.withOpacity(0.75), + leftButtonTextColor: Palette.brightOrange); + + @override + OrderTheme get orderTheme => OrderTheme(iconColor: Colors.black); + + @override + SendPageTheme get sendPageTheme => SendPageTheme( + templateTitleColor: Palette.darkBlueCraiola, + templateBackgroundColor: Palette.blueAlice, + templateNewTextColor: Palette.darkBlueCraiola, + templateDottedBorderColor: Palette.moderateLavender, + templateSelectedCurrencyBackgroundColor: Colors.white, + templateSelectedCurrencyTitleColor: primaryColor, + estimatedFeeColor: Colors.white.withOpacity(0.5), + textFieldButtonIconColor: Colors.white, + textFieldButtonColor: Colors.white.withOpacity(0.2), + textFieldHintColor: Colors.white.withOpacity(0.5), + textFieldBorderColor: Colors.white.withOpacity(0.5), + secondGradientColor: Palette.blueGreyCraiola, + firstGradientColor: Palette.blueCraiola, + indicatorDotColor: PaletteDark.darkCyanBlue.withOpacity(0.67)); + + @override + SeedWidgetTheme get seedWidgetTheme => + SeedWidgetTheme(hintTextColor: Palette.darkGray); + + @override + PlaceholderTheme get placeholderTheme => + PlaceholderTheme(color: PaletteDark.darkCyanBlue); + + @override + TransactionTradeTheme get transactionTradeTheme => TransactionTradeTheme( + detailsTitlesColor: Palette.darkGray, rowsColor: Palette.blueAlice); + + @override + CakeTextTheme get cakeTextTheme => CakeTextTheme( + secondaryTextColor: PaletteDark.pigeonBlue, + textfieldUnderlineColor: Palette.wildPeriwinkle, + titleColor: Palette.violetBlue, + addressButtonBorderColor: Palette.blueAlice, + dateSectionRowColor: PaletteDark.darkCyanBlue); + + @override + AccountListTheme get accountListTheme => AccountListTheme( + currentAccountBackgroundColor: dialogBackgroundColor, + currentAccountTextColor: primaryColor, + currentAccountAmountColor: receivePageTheme.iconsColor, + tilesBackgroundColor: Colors.white, + tilesAmountColor: receivePageTheme.iconsColor, + tilesTextColor: Palette.violetBlue); + + @override + ReceivePageTheme get receivePageTheme => ReceivePageTheme( + currentTileBackgroundColor: Palette.blueCraiola, + currentTileTextColor: Colors.white, + tilesBackgroundColor: Palette.blueAlice, + tilesTextColor: Palette.darkBlueCraiola, + iconsBackgroundColor: Palette.moderateLavender, + iconsColor: PaletteDark.lightBlueGrey, + amountBottomBorderColor: Palette.darkBlueCraiola, + amountHintTextColor: Palette.darkBlueCraiola); + + @override + QRCodeTheme get qrCodeTheme => QRCodeTheme( + qrCodeColor: Colors.white, + qrWidgetCopyButtonColor: PaletteDark.lightBlueGrey); + + @override + ThemeData get themeData => super.themeData.copyWith( + dividerColor: Palette.paleBlue, + hintColor: Palette.gray, + disabledColor: Palette.darkGray, + dialogTheme: + super.themeData.dialogTheme.copyWith(backgroundColor: Colors.white)); } diff --git a/lib/themes/matrix_green_theme.dart b/lib/themes/matrix_green_theme.dart new file mode 100644 index 000000000..30e294415 --- /dev/null +++ b/lib/themes/matrix_green_theme.dart @@ -0,0 +1,14 @@ +import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/themes/monero_dark_theme.dart'; +import 'package:flutter/material.dart'; + +class MatrixGreenTheme extends MoneroDarkTheme { + MatrixGreenTheme({required int raw}) : super(raw: raw); + + @override + String get title => S.current.matrix_green_dark_theme; + @override + Color get primaryColor => PaletteDark.matrixGreen; +} + diff --git a/lib/themes/monero_dark_theme.dart b/lib/themes/monero_dark_theme.dart new file mode 100644 index 000000000..4931d74bc --- /dev/null +++ b/lib/themes/monero_dark_theme.dart @@ -0,0 +1,194 @@ +import 'package:cake_wallet/themes/dark_theme.dart'; +import 'package:cake_wallet/themes/extensions/account_list_theme.dart'; +import 'package:cake_wallet/themes/extensions/address_theme.dart'; +import 'package:cake_wallet/themes/extensions/alert_theme.dart'; +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; +import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart'; +import 'package:cake_wallet/themes/extensions/info_theme.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; +import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; +import 'package:cake_wallet/themes/extensions/picker_theme.dart'; +import 'package:cake_wallet/themes/extensions/pin_code_theme.dart'; +import 'package:cake_wallet/themes/extensions/qr_code_theme.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; +import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; +import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/palette.dart'; +import 'package:flutter/material.dart'; + +class MoneroDarkTheme extends DarkTheme { + MoneroDarkTheme({required int raw}) : super(raw: raw); + + @override + String get title => S.current.monero_dark_theme; + @override + Color get backgroundColor => Colors.black; + @override + Color get primaryColor => PaletteDark.moneroOrange; + @override + Color get containerColor => PaletteDark.moneroCard; + @override + Color get dialogBackgroundColor => containerColor; + + @override + CakeScrollbarTheme get scrollbarTheme => + super.scrollbarTheme.copyWith(thumbColor: Colors.grey); + + @override + SyncIndicatorTheme get syncIndicatorStyle => + super.syncIndicatorStyle.copyWith( + textColor: Colors.white, + notSyncedBackgroundColor: Colors.grey.withOpacity(0.2), + syncedBackgroundColor: containerColor); + + @override + PinCodeTheme get pinCodeTheme => super + .pinCodeTheme + .copyWith(indicatorsColor: primaryColor, switchColor: Colors.grey); + + @override + ExchangePageTheme get exchangePageTheme => super.exchangePageTheme.copyWith( + hintTextColor: Colors.grey, + qrCodeColor: primaryTextColor, + buttonBackgroundColor: colorScheme.surfaceVariant, + textFieldButtonColor: colorScheme.onInverseSurface, + textFieldBorderBottomPanelColor: colorScheme.surfaceVariant, + textFieldBorderTopPanelColor: colorScheme.surfaceVariant, + secondGradientBottomPanelColor: containerColor, + firstGradientBottomPanelColor: containerColor, + secondGradientTopPanelColor: colorScheme.surface, + firstGradientTopPanelColor: colorScheme.surface, + receiveAmountColor: colorScheme.surfaceVariant); + + @override + NewWalletTheme get newWalletTheme => super + .newWalletTheme + .copyWith(hintTextColor: Colors.grey, underlineColor: Colors.grey); + + @override + AddressTheme get addressTheme => + super.addressTheme.copyWith(actionButtonColor: containerColor); + + @override + DashboardPageTheme get dashboardPageTheme => + super.dashboardPageTheme.copyWith( + pageTitleTextColor: primaryColor, + mainActionsIconColor: primaryColor, + indicatorDotTheme: IndicatorDotTheme( + indicatorColor: colorScheme.secondaryContainer, + activeIndicatorColor: colorScheme.inversePrimary)); + @override + BalancePageTheme get balancePageTheme => super.balancePageTheme.copyWith( + cardBorderColor: primaryColor.withOpacity(0.2), + labelTextColor: Colors.grey, + balanceAmountColor: primaryColor, + assetTitleColor: primaryColor); + + @override + CakeMenuTheme get menuTheme => super.menuTheme.copyWith( + headerFirstGradientColor: containerColor, + headerSecondGradientColor: containerColor, + backgroundColor: containerColor, + subnameTextColor: Colors.grey, + dividerColor: colorScheme.secondaryContainer, + iconColor: colorScheme.secondaryContainer, + settingActionsIconColor: colorScheme.secondaryContainer); + + @override + FilterTheme get filterTheme => super.filterTheme.copyWith( + checkboxFirstGradientColor: colorScheme.secondaryContainer, + checkboxSecondGradientColor: colorScheme.inversePrimary, + checkboxBoundsColor: PaletteDark.wildVioletBlue, + checkboxBackgroundColor: PaletteDark.wildVioletBlue.withOpacity(0.3), + buttonColor: containerColor, + iconColor: Colors.grey); + + @override + WalletListTheme get walletListTheme => super.walletListTheme.copyWith( + restoreWalletButtonTextColor: Colors.white, + createNewWalletButtonBackgroundColor: primaryColor); + + @override + InfoTheme get infoTheme => super.infoTheme.copyWith(textColor: Colors.grey); + + @override + PickerTheme get pickerTheme => + super.pickerTheme.copyWith(dividerColor: Colors.grey.withOpacity(0.5)); + + @override + SendPageTheme get sendPageTheme => super.sendPageTheme.copyWith( + templateNewTextColor: + dashboardPageTheme.indicatorDotTheme.activeIndicatorColor, + templateTitleColor: primaryTextColor, + templateBackgroundColor: containerColor, + templateDottedBorderColor: colorScheme.primaryContainer, + templateSelectedCurrencyTitleColor: Colors.black, + textFieldButtonIconColor: colorScheme.inverseSurface, + textFieldButtonColor: colorScheme.onInverseSurface, + textFieldHintColor: Colors.grey.withOpacity(0.5), + textFieldBorderColor: Colors.grey.withOpacity(0.5), + secondGradientColor: containerColor, + firstGradientColor: containerColor, + indicatorDotColor: dashboardPageTheme.indicatorDotTheme.indicatorColor); + + @override + SeedWidgetTheme get seedWidgetTheme => + super.seedWidgetTheme.copyWith(hintTextColor: Colors.grey); + + @override + TransactionTradeTheme get transactionTradeTheme => super + .transactionTradeTheme + .copyWith(detailsTitlesColor: Colors.grey, rowsColor: containerColor); + + @override + CakeTextTheme get cakeTextTheme => super.cakeTextTheme.copyWith( + secondaryTextColor: Colors.grey, + addressButtonBorderColor: primaryColor.withOpacity(0.2), + dateSectionRowColor: Colors.grey, + textfieldUnderlineColor: Colors.grey.withOpacity(0.5)); + + @override + AccountListTheme get accountListTheme => + super.accountListTheme.copyWith(tilesBackgroundColor: containerColor); + + @override + ReceivePageTheme get receivePageTheme => super.receivePageTheme.copyWith( + currentTileBackgroundColor: primaryColor, + currentTileTextColor: Colors.white, + tilesBackgroundColor: containerColor, + iconsBackgroundColor: colorScheme.onInverseSurface, + iconsColor: colorScheme.inverseSurface, + amountBottomBorderColor: Colors.grey, + amountHintTextColor: Colors.grey); + + @override + QRCodeTheme get qrCodeTheme => QRCodeTheme( + qrCodeColor: Colors.grey, qrWidgetCopyButtonColor: Colors.grey); + + @override + AlertTheme get alertTheme => super + .alertTheme + .copyWith(backdropColor: colorScheme.surface.withOpacity(0.75)); + + @override + ThemeData get themeData => super.themeData.copyWith( + dividerColor: pickerTheme.dividerColor, + hintColor: Colors.grey, + dialogTheme: + super.themeData.dialogTheme.copyWith(backgroundColor: containerColor), + appBarTheme: super.themeData.appBarTheme.copyWith( + titleTextStyle: super + .themeData + .appBarTheme + .titleTextStyle! + .copyWith(color: primaryColor))); +} diff --git a/lib/themes/monero_light_theme.dart b/lib/themes/monero_light_theme.dart new file mode 100644 index 000000000..cf046e736 --- /dev/null +++ b/lib/themes/monero_light_theme.dart @@ -0,0 +1,159 @@ +import 'package:cake_wallet/themes/extensions/account_list_theme.dart'; +import 'package:cake_wallet/themes/extensions/address_theme.dart'; +import 'package:cake_wallet/themes/extensions/alert_theme.dart'; +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; +import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; +import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; +import 'package:cake_wallet/themes/extensions/qr_code_theme.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; +import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; +import 'package:cake_wallet/themes/light_theme.dart'; +import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/generated/i18n.dart'; +import 'package:flutter/material.dart'; + +class MoneroLightTheme extends LightTheme { + MoneroLightTheme({required int raw}) : super(raw: raw); + + @override + String get title => S.current.monero_light_theme; + @override + Color get primaryColor => Palette.moneroOrange; + @override + Color get containerColor => Palette.moneroLightOrange; + @override + Color get primaryTextColor => colorScheme.onPrimaryContainer; + @override + Color get dialogBackgroundColor => containerColor; + + @override + SyncIndicatorTheme get syncIndicatorStyle => + super.syncIndicatorStyle.copyWith( + textColor: primaryTextColor, + syncedBackgroundColor: colorScheme.primaryContainer, + notSyncedBackgroundColor: containerColor.withOpacity(0.75)); + + @override + ExchangePageTheme get exchangePageTheme => super.exchangePageTheme.copyWith( + qrCodeColor: primaryTextColor, + buttonBackgroundColor: containerColor, + secondGradientBottomPanelColor: primaryColor.withOpacity(0.7), + firstGradientBottomPanelColor: colorScheme.primary.withOpacity(0.7), + secondGradientTopPanelColor: primaryColor, + firstGradientTopPanelColor: colorScheme.primary, + textFieldBorderBottomPanelColor: colorScheme.surfaceVariant, + textFieldBorderTopPanelColor: colorScheme.surfaceVariant, + receiveAmountColor: colorScheme.surfaceVariant); + + @override + NewWalletTheme get newWalletTheme => super.newWalletTheme.copyWith( + hintTextColor: colorScheme.secondary, + underlineColor: colorScheme.secondary); + + @override + AddressTheme get addressTheme => + super.addressTheme.copyWith(actionButtonColor: containerColor); + + @override + DashboardPageTheme get dashboardPageTheme => + super.dashboardPageTheme.copyWith( + indicatorDotTheme: IndicatorDotTheme( + indicatorColor: colorScheme.secondaryContainer, + activeIndicatorColor: colorScheme.inversePrimary)); + @override + BalancePageTheme get balancePageTheme => super.balancePageTheme.copyWith( + textColor: primaryTextColor.withOpacity(0.67), + labelTextColor: colorScheme.secondary); + + @override + CakeMenuTheme get menuTheme => super.menuTheme.copyWith( + headerFirstGradientColor: colorScheme.primary, + headerSecondGradientColor: primaryColor, + dividerColor: colorScheme.secondaryContainer, + iconColor: colorScheme.secondaryContainer, + settingActionsIconColor: colorScheme.secondary); + + @override + FilterTheme get filterTheme => super.filterTheme.copyWith( + checkboxFirstGradientColor: colorScheme.secondaryContainer, + checkboxSecondGradientColor: colorScheme.inversePrimary, + checkboxBoundsColor: PaletteDark.wildVioletBlue, + checkboxBackgroundColor: PaletteDark.wildVioletBlue.withOpacity(0.3), + buttonColor: containerColor, + iconColor: colorScheme.secondary); + + @override + WalletListTheme get walletListTheme => super.walletListTheme.copyWith( + restoreWalletButtonTextColor: Colors.white, + createNewWalletButtonBackgroundColor: primaryColor); + + @override + SendPageTheme get sendPageTheme => super.sendPageTheme.copyWith( + templateTitleColor: primaryTextColor, + templateBackgroundColor: containerColor, + templateNewTextColor: primaryTextColor, + templateDottedBorderColor: colorScheme.primaryContainer, + secondGradientColor: primaryColor, + firstGradientColor: colorScheme.primary, + indicatorDotColor: dashboardPageTheme.indicatorDotTheme.indicatorColor); + + @override + SeedWidgetTheme get seedWidgetTheme => + super.seedWidgetTheme.copyWith(hintTextColor: colorScheme.secondary); + + @override + TransactionTradeTheme get transactionTradeTheme => + super.transactionTradeTheme.copyWith( + detailsTitlesColor: colorScheme.secondary, rowsColor: containerColor); + + @override + CakeTextTheme get cakeTextTheme => super.cakeTextTheme.copyWith( + titleColor: primaryTextColor, + secondaryTextColor: colorScheme.secondary, + addressButtonBorderColor: primaryColor.withOpacity(0.2), + dateSectionRowColor: colorScheme.secondary, + textfieldUnderlineColor: colorScheme.secondary.withOpacity(0.5)); + + @override + AccountListTheme get accountListTheme => + super.accountListTheme.copyWith(tilesBackgroundColor: containerColor); + + @override + ReceivePageTheme get receivePageTheme => super.receivePageTheme.copyWith( + currentTileBackgroundColor: primaryColor, + tilesBackgroundColor: containerColor, + tilesTextColor: primaryTextColor, + iconsBackgroundColor: colorScheme.surfaceVariant, + iconsColor: colorScheme.onSurfaceVariant, + amountBottomBorderColor: primaryTextColor, + amountHintTextColor: primaryTextColor, + currentTileTextColor: Colors.white); + + @override + QRCodeTheme get qrCodeTheme => super + .qrCodeTheme + .copyWith(qrWidgetCopyButtonColor: colorScheme.secondary); + + @override + AlertTheme get alertTheme => super + .alertTheme + .copyWith(backdropColor: colorScheme.inverseSurface.withOpacity(0.75)); + + @override + ThemeData get themeData => super.themeData.copyWith( + dividerColor: pickerTheme.dividerColor, + hintColor: colorScheme.secondary, + dialogTheme: super + .themeData + .dialogTheme + .copyWith(backgroundColor: containerColor)); +} diff --git a/lib/themes/theme_base.dart b/lib/themes/theme_base.dart index 50406652a..6151f0e83 100644 --- a/lib/themes/theme_base.dart +++ b/lib/themes/theme_base.dart @@ -1,17 +1,157 @@ +import 'package:cake_wallet/themes/extensions/account_list_theme.dart'; +import 'package:cake_wallet/themes/extensions/address_theme.dart'; +import 'package:cake_wallet/themes/extensions/alert_theme.dart'; +import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/filter_theme.dart'; +import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart'; +import 'package:cake_wallet/themes/extensions/info_theme.dart'; +import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; +import 'package:cake_wallet/themes/extensions/menu_theme.dart'; +import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; +import 'package:cake_wallet/themes/extensions/order_theme.dart'; +import 'package:cake_wallet/themes/extensions/picker_theme.dart'; +import 'package:cake_wallet/themes/extensions/pin_code_theme.dart'; +import 'package:cake_wallet/themes/extensions/placeholder_theme.dart'; +import 'package:cake_wallet/themes/extensions/qr_code_theme.dart'; +import 'package:cake_wallet/themes/extensions/receive_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart'; +import 'package:cake_wallet/themes/extensions/send_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/support_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; +import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; +import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; import 'package:flutter/material.dart'; -enum ThemeType {light, bright, dark} +enum ThemeType { bright, light, dark } abstract class ThemeBase { - ThemeBase({required this.raw}); + ThemeBase({required this.raw}) { + colorScheme = ColorScheme.fromSeed( + brightness: brightness, + seedColor: primaryColor, + background: backgroundColor); + } final int raw; String get title; - ThemeData get themeData; ThemeType get type; @override String toString() { return title; } -} \ No newline at end of file + + Brightness get brightness; + Color get backgroundColor; + Color get primaryColor; + Color get primaryTextColor; + Color get containerColor; + Color get dialogBackgroundColor; + + ColorScheme colorScheme = ColorScheme.light(); + + ThemeData get generatedThemeData => ThemeData.from( + colorScheme: colorScheme, + textTheme: TextTheme().apply(fontFamily: 'Lato')); + + DashboardPageTheme get dashboardPageTheme => DashboardPageTheme( + firstGradientBackgroundColor: backgroundColor, + secondGradientBackgroundColor: backgroundColor, + thirdGradientBackgroundColor: backgroundColor, + textColor: primaryTextColor, + indicatorDotTheme: IndicatorDotTheme( + indicatorColor: primaryColor, activeIndicatorColor: backgroundColor)); + + CakeScrollbarTheme get scrollbarTheme; + + SyncIndicatorTheme get syncIndicatorStyle; + + KeyboardTheme get keyboardTheme; + + PinCodeTheme get pinCodeTheme; + + SupportPageTheme get supportPageTheme; + + ExchangePageTheme get exchangePageTheme; + + NewWalletTheme get newWalletTheme; + + BalancePageTheme get balancePageTheme; + + AddressTheme get addressTheme; + + CakeMenuTheme get menuTheme; + + FilterTheme get filterTheme; + + WalletListTheme get walletListTheme; + + InfoTheme get infoTheme; + + PickerTheme get pickerTheme; + + AlertTheme get alertTheme; + + OrderTheme get orderTheme; + + SendPageTheme get sendPageTheme; + + SeedWidgetTheme get seedWidgetTheme; + + PlaceholderTheme get placeholderTheme; + + TransactionTradeTheme get transactionTradeTheme; + + CakeTextTheme get cakeTextTheme; + + AccountListTheme get accountListTheme; + + ReceivePageTheme get receivePageTheme; + + QRCodeTheme get qrCodeTheme; + + ThemeData get themeData => generatedThemeData.copyWith( + primaryColor: primaryColor, + cardColor: containerColor, + dialogBackgroundColor: dialogBackgroundColor, + extensions: [ + dashboardPageTheme, + scrollbarTheme, + syncIndicatorStyle, + keyboardTheme, + pinCodeTheme, + supportPageTheme, + exchangePageTheme, + newWalletTheme, + balancePageTheme, + addressTheme, + menuTheme, + filterTheme, + walletListTheme, + infoTheme, + pickerTheme, + alertTheme, + orderTheme, + sendPageTheme, + seedWidgetTheme, + placeholderTheme, + transactionTradeTheme, + cakeTextTheme, + accountListTheme, + receivePageTheme, + qrCodeTheme, + ], + scrollbarTheme: generatedThemeData.scrollbarTheme.copyWith( + thumbColor: MaterialStateProperty.all(scrollbarTheme.thumbColor), + trackColor: MaterialStateProperty.all(scrollbarTheme.trackColor), + radius: Radius.circular(3), + thickness: MaterialStateProperty.all(6), + thumbVisibility: MaterialStateProperty.all(true), + crossAxisMargin: 6), + appBarTheme: generatedThemeData.appBarTheme.copyWith( + titleTextStyle: TextStyle(color: cakeTextTheme.titleColor))); +} diff --git a/lib/themes/theme_list.dart b/lib/themes/theme_list.dart index 941e23f82..cb65dc2b9 100644 --- a/lib/themes/theme_list.dart +++ b/lib/themes/theme_list.dart @@ -1,14 +1,36 @@ import 'package:cake_wallet/themes/bright_theme.dart'; import 'package:cake_wallet/themes/dark_theme.dart'; import 'package:cake_wallet/themes/light_theme.dart'; +import 'package:cake_wallet/themes/monero_light_theme.dart'; +import 'package:cake_wallet/themes/monero_dark_theme.dart'; +import 'package:cake_wallet/themes/matrix_green_theme.dart'; +import 'package:cake_wallet/themes/bitcoin_dark_theme.dart'; +import 'package:cake_wallet/themes/bitcoin_light_theme.dart'; +import 'package:cake_wallet/themes/high_contrast_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; class ThemeList { - static final all = [brightTheme, lightTheme, darkTheme]; + static final all = [ + brightTheme, + lightTheme, + darkTheme, + moneroDarkTheme, + moneroLightTheme, + matrixGreenTheme, + bitcoinDarkTheme, + bitcoinLightTheme, + highContrastTheme + ]; static final lightTheme = LightTheme(raw: 0); static final brightTheme = BrightTheme(raw: 1); static final darkTheme = DarkTheme(raw: 2); + static final moneroDarkTheme = MoneroDarkTheme(raw: 3); + static final moneroLightTheme = MoneroLightTheme(raw: 4); + static final matrixGreenTheme = MatrixGreenTheme(raw: 5); + static final bitcoinDarkTheme = BitcoinDarkTheme(raw: 6); + static final bitcoinLightTheme = BitcoinLightTheme(raw: 7); + static final highContrastTheme = HighContrastTheme(raw: 8); static ThemeBase deserialize({required int raw}) { switch (raw) { @@ -18,8 +40,21 @@ class ThemeList { return brightTheme; case 2: return darkTheme; + case 3: + return moneroDarkTheme; + case 4: + return moneroLightTheme; + case 5: + return matrixGreenTheme; + case 6: + return bitcoinDarkTheme; + case 7: + return bitcoinLightTheme; + case 8: + return highContrastTheme; default: - throw Exception('Unexpected token raw: $raw for deserialization of ThemeBase'); + throw Exception( + 'Unexpected token raw: $raw for deserialization of ThemeBase'); } } } \ No newline at end of file diff --git a/res/values/strings_ar.arb b/res/values/strings_ar.arb index 63905a94b..573ad120c 100644 --- a/res/values/strings_ar.arb +++ b/res/values/strings_ar.arb @@ -666,6 +666,12 @@ "balance_page": "صفحة التوازن", "share": "يشارك", "slidable": "قابل للانزلاق", + "monero_dark_theme": "موضوع مونيرو الظلام", + "bitcoin_dark_theme": "موضوع البيتكوين الظلام", + "bitcoin_light_theme": "موضوع البيتكوين الخفيفة", + "high_contrast_theme": "موضوع عالي التباين", + "matrix_green_dark_theme": "موضوع ماتريكس الأخضر الداكن", + "monero_light_theme": " ضوء مونيرو", "etherscan_history": "Etherscan تاريخ", "manage_nodes": "ﺪﻘﻌﻟﺍ ﺓﺭﺍﺩﺇ", "template_name": "اسم القالب", @@ -675,4 +681,4 @@ "support_description_guides": "توثيق ودعم القضايا المشتركة", "support_title_other_links": "روابط دعم أخرى", "support_description_other_links": "انضم إلى مجتمعاتنا أو تصل إلينا شركائنا من خلال أساليب أخرى" -} \ No newline at end of file +} diff --git a/res/values/strings_bg.arb b/res/values/strings_bg.arb index 5563f0c20..d6ddaf5a6 100644 --- a/res/values/strings_bg.arb +++ b/res/values/strings_bg.arb @@ -662,6 +662,12 @@ "balance_page": "Страница за баланс", "share": "Дял", "slidable": "Плъзгащ се", + "monero_dark_theme": "Тъмна тема Monero", + "bitcoin_dark_theme": "Тъмна тема за биткойн", + "bitcoin_light_theme": "Лека биткойн тема", + "high_contrast_theme": "Тема с висок контраст", + "matrix_green_dark_theme": "Зелена тъмна тема Matrix", + "monero_light_theme": "Лека тема Monero", "etherscan_history": "История на Etherscan", "manage_nodes": "Управление на възли", "template_name": "Име на шаблон", diff --git a/res/values/strings_cs.arb b/res/values/strings_cs.arb index b528d6237..42b69d87a 100644 --- a/res/values/strings_cs.arb +++ b/res/values/strings_cs.arb @@ -662,6 +662,12 @@ "balance_page": "Stránka zůstatku", "share": "Podíl", "slidable": "Posuvné", + "monero_dark_theme": "Tmavé téma Monero", + "bitcoin_dark_theme": "Tmavé téma bitcoinů", + "bitcoin_light_theme": "Světlé téma bitcoinů", + "high_contrast_theme": "Téma s vysokým kontrastem", + "matrix_green_dark_theme": "Tmavé téma Matrix Green", + "monero_light_theme": "Světlé téma Monero", "manage_nodes": "Spravovat uzly", "etherscan_history": "Historie Etherscanu", "template_name": "Název šablony", diff --git a/res/values/strings_de.arb b/res/values/strings_de.arb index 211708c28..12d03d079 100644 --- a/res/values/strings_de.arb +++ b/res/values/strings_de.arb @@ -634,6 +634,12 @@ "setup_totp_recommended": "TOTP einrichten (empfohlen)", "disable_buy": "Kaufaktion deaktivieren", "disable_sell": "Verkaufsaktion deaktivieren", + "monero_dark_theme": "Dunkles Monero-Thema", + "bitcoin_dark_theme": "Dunkles Bitcoin-Thema", + "bitcoin_light_theme": "Bitcoin Light-Thema", + "high_contrast_theme": "Kontrastreiches Thema", + "matrix_green_dark_theme": "Matrix Green Dark Theme", + "monero_light_theme": "Monero Light-Thema", "cake_2fa_preset" : "Kuchen 2FA-Voreinstellung", "narrow": "Eng", "normal": "Normal", diff --git a/res/values/strings_en.arb b/res/values/strings_en.arb index 4de56de80..3d1ea44fa 100644 --- a/res/values/strings_en.arb +++ b/res/values/strings_en.arb @@ -634,6 +634,12 @@ "setup_totp_recommended": "Set up TOTP (Recommended)", "disable_buy": "Disable buy action", "disable_sell": "Disable sell action", + "monero_dark_theme": "Monero Dark Theme", + "bitcoin_dark_theme": "Bitcoin Dark Theme", + "bitcoin_light_theme": "Bitcoin Light Theme", + "high_contrast_theme": "High Contrast Theme", + "matrix_green_dark_theme": "Matrix Green Dark Theme", + "monero_light_theme": "Monero Light Theme", "cake_2fa_preset" : "Cake 2FA Preset", "narrow": "Narrow", "normal": "Normal", diff --git a/res/values/strings_es.arb b/res/values/strings_es.arb index 7910e8515..1faa6d78c 100644 --- a/res/values/strings_es.arb +++ b/res/values/strings_es.arb @@ -634,6 +634,12 @@ "setup_totp_recommended": "Configurar TOTP (Recomendado)", "disable_buy": "Desactivar acción de compra", "disable_sell": "Desactivar acción de venta", + "monero_dark_theme": "Tema oscuro de Monero", + "bitcoin_dark_theme": "Tema oscuro de Bitcoin", + "bitcoin_light_theme": "Tema de la luz de Bitcoin", + "high_contrast_theme": "Tema de alto contraste", + "matrix_green_dark_theme": "Matrix verde oscuro tema", + "monero_light_theme": "Tema ligero de Monero", "cake_2fa_preset" : "Pastel 2FA preestablecido", "narrow": "Angosto", "normal": "Normal", diff --git a/res/values/strings_fr.arb b/res/values/strings_fr.arb index 240e5821e..548f74192 100644 --- a/res/values/strings_fr.arb +++ b/res/values/strings_fr.arb @@ -634,6 +634,12 @@ "setup_totp_recommended": "Configurer TOTP (recommandé)", "disable_buy": "Désactiver l'action d'achat", "disable_sell": "Désactiver l'action de vente", + "monero_dark_theme": "Thème sombre Monero", + "bitcoin_dark_theme": "Thème sombre Bitcoin", + "bitcoin_light_theme": "Thème léger Bitcoin", + "high_contrast_theme": "Thème à contraste élevé", + "matrix_green_dark_theme": "Thème Matrix Green Dark", + "monero_light_theme": "Thème de lumière Monero", "cake_2fa_preset" : "Gâteau 2FA prédéfini", "narrow": "Étroit", "normal": "Normal", diff --git a/res/values/strings_ha.arb b/res/values/strings_ha.arb index 5a232be2d..20ae66c33 100644 --- a/res/values/strings_ha.arb +++ b/res/values/strings_ha.arb @@ -612,6 +612,12 @@ "prevent_screenshots": "Fada lambobi da jarrabobi na kayan lambobi", "disable_buy": "Kashe alama", "disable_sell": "Kashe karbuwa", + "monero_dark_theme": "Monero Dark Jigo", + "bitcoin_dark_theme": "Bitcoin Dark Jigo", + "bitcoin_light_theme": "Jigon Hasken Bitcoin", + "high_contrast_theme": "Babban Jigon Kwatance", + "matrix_green_dark_theme": "Matrix Green Dark Jigo", + "monero_light_theme": "Jigon Hasken Monero", "cake_2fa_preset" : "Cake 2FA saiti", "narrow": "kunkuntar", "normal": "Na al'ada", diff --git a/res/values/strings_hi.arb b/res/values/strings_hi.arb index f60bf7180..afbd3bb47 100644 --- a/res/values/strings_hi.arb +++ b/res/values/strings_hi.arb @@ -634,6 +634,12 @@ "setup_totp_recommended": "टीओटीपी सेट अप करें (अनुशंसित)", "disable_buy": "खरीद कार्रवाई अक्षम करें", "disable_sell": "बेचने की कार्रवाई अक्षम करें", + "monero_dark_theme": "मोनेरो डार्क थीम", + "bitcoin_dark_theme": "बिटकॉइन डार्क थीम", + "bitcoin_light_theme": "बिटकॉइन लाइट थीम", + "high_contrast_theme": "उच्च कंट्रास्ट थीम", + "matrix_green_dark_theme": "मैट्रिक्स ग्रीन डार्क थीम", + "monero_light_theme": "मोनेरो लाइट थीम", "cake_2fa_preset" : "केक 2एफए प्रीसेट", "narrow": "सँकरा", "normal": "सामान्य", diff --git a/res/values/strings_hr.arb b/res/values/strings_hr.arb index 1b6592102..a014cf8f8 100644 --- a/res/values/strings_hr.arb +++ b/res/values/strings_hr.arb @@ -634,6 +634,12 @@ "setup_totp_recommended": "Postavite TOTP (preporučeno)", "disable_buy": "Onemogući kupnju", "disable_sell": "Onemogući akciju prodaje", + "monero_dark_theme": "Monero tamna tema", + "bitcoin_dark_theme": "Bitcoin Tamna tema", + "bitcoin_light_theme": "Bitcoin Light Theme", + "high_contrast_theme": "Tema visokog kontrasta", + "matrix_green_dark_theme": "Matrix Green Dark Theme", + "monero_light_theme": "Monero lagana tema", "cake_2fa_preset" : "Cake 2FA Preset", "narrow": "Usko", "normal": "Normalno", diff --git a/res/values/strings_id.arb b/res/values/strings_id.arb index 313d0a358..1011a3c6b 100644 --- a/res/values/strings_id.arb +++ b/res/values/strings_id.arb @@ -658,6 +658,12 @@ "balance_page": "Halaman Saldo", "share": "Membagikan", "slidable": "Dapat digeser", + "monero_dark_theme": "Tema Gelap Monero", + "bitcoin_dark_theme": "Tema Gelap Bitcoin", + "bitcoin_light_theme": "Tema Cahaya Bitcoin", + "high_contrast_theme": "Tema Kontras Tinggi", + "matrix_green_dark_theme": "Tema Matrix Green Dark", + "monero_light_theme": "Tema Cahaya Monero", "manage_nodes": "Kelola node", "etherscan_history": "Sejarah Etherscan", "template_name": "Nama Templat", diff --git a/res/values/strings_it.arb b/res/values/strings_it.arb index a1cdc676a..e327d7c6d 100644 --- a/res/values/strings_it.arb +++ b/res/values/strings_it.arb @@ -670,6 +670,12 @@ "balance_page": "Pagina di equilibrio", "share": "Condividere", "slidable": "Scorrevole", + "monero_dark_theme": "Tema scuro di Monero", + "bitcoin_dark_theme": "Tema oscuro di Bitcoin", + "bitcoin_light_theme": "Tema luce Bitcoin", + "high_contrast_theme": "Tema ad alto contrasto", + "matrix_green_dark_theme": "Tema Matrix verde scuro", + "monero_light_theme": "Tema leggero Monero", "manage_nodes": "Gestisci i nodi", "etherscan_history": "Storia Etherscan", "template_name": "Nome modello", diff --git a/res/values/strings_ja.arb b/res/values/strings_ja.arb index 787876204..8d7b2f601 100644 --- a/res/values/strings_ja.arb +++ b/res/values/strings_ja.arb @@ -670,6 +670,12 @@ "balance_page": "残高ページ", "share": "共有", "slidable": "スライド可能", + "monero_dark_theme": "モネロダークテーマ", + "bitcoin_dark_theme": "ビットコインダークテーマ", + "bitcoin_light_theme": "ビットコインライトテーマ", + "high_contrast_theme": "ハイコントラストテーマ", + "matrix_green_dark_theme": "マトリックスグリーンダークテーマ", + "monero_light_theme": "モネロ ライト テーマ", "manage_nodes": "ノードの管理", "etherscan_history": "イーサスキャンの歴史", "template_name": "テンプレート名", @@ -679,4 +685,4 @@ "support_description_guides": "一般的な問題のドキュメントとサポート", "support_title_other_links": "その他のサポートリンク", "support_description_other_links": "私たちのコミュニティに参加するか、他の方法を通して私たちのパートナーに連絡してください" -} \ No newline at end of file +} diff --git a/res/values/strings_ko.arb b/res/values/strings_ko.arb index 76014f54b..16422319d 100644 --- a/res/values/strings_ko.arb +++ b/res/values/strings_ko.arb @@ -670,6 +670,12 @@ "balance_page": "잔액 페이지", "share": "공유하다", "slidable": "슬라이딩 가능", + "monero_dark_theme": "모네로 다크 테마", + "bitcoin_dark_theme": "비트코인 다크 테마", + "bitcoin_light_theme": "비트코인 라이트 테마", + "high_contrast_theme": "고대비 테마", + "matrix_green_dark_theme": "매트릭스 그린 다크 테마", + "monero_light_theme": "모네로 라이트 테마", "manage_nodes": "노드 관리", "etherscan_history": "이더스캔 역사", "template_name": "템플릿 이름", @@ -679,4 +685,4 @@ "support_description_guides": "일반적인 문제에 대한 문서화 및 지원", "support_title_other_links": "다른 지원 링크", "support_description_other_links": "다른 방법을 통해 커뮤니티에 가입하거나 파트너에게 연락하십시오." -} \ No newline at end of file +} diff --git a/res/values/strings_my.arb b/res/values/strings_my.arb index b3ba2a7dd..0a599c16a 100644 --- a/res/values/strings_my.arb +++ b/res/values/strings_my.arb @@ -668,6 +668,12 @@ "balance_page": "လက်ကျန်စာမျက်နှာ", "share": "မျှဝေပါ။", "slidable": "လျှောချနိုင်သည်။", + "monero_dark_theme": "Monero Dark အပြင်အဆင်", + "bitcoin_dark_theme": "Bitcoin Dark Theme", + "bitcoin_light_theme": "Bitcoin Light အပြင်အဆင်", + "high_contrast_theme": "အလင်းအမှောင် မြင့်မားသော အပြင်အဆင်", + "matrix_green_dark_theme": "Matrix Green Dark အပြင်အဆင်", + "monero_light_theme": "Monero Light အပြင်အဆင်", "manage_nodes": "ဆုံမှတ်များကို စီမံပါ။", "etherscan_history": "Etherscan သမိုင်း", "template_name": "နမူနာပုံစံ", @@ -677,4 +683,4 @@ "support_description_guides": "ဘုံပြ issues နာများအတွက်စာရွက်စာတမ်းများနှင့်ထောက်ခံမှု", "support_title_other_links": "အခြားအထောက်အပံ့လင့်များ", "support_description_other_links": "ကျွန်ုပ်တို့၏လူမှုအသိုင်းအဝိုင်းများသို့ 0 င်ရောက်ပါ" -} \ No newline at end of file +} diff --git a/res/values/strings_nl.arb b/res/values/strings_nl.arb index aca33d051..00eaf4dc8 100644 --- a/res/values/strings_nl.arb +++ b/res/values/strings_nl.arb @@ -670,6 +670,12 @@ "balance_page": "Saldo pagina", "share": "Deel", "slidable": "Verschuifbaar", + "monero_dark_theme": "Monero donker thema", + "bitcoin_dark_theme": "Bitcoin donker thema", + "bitcoin_light_theme": "Bitcoin Light-thema", + "high_contrast_theme": "Thema met hoog contrast", + "matrix_green_dark_theme": "Matrix groen donker thema", + "monero_light_theme": "Monero Light-thema", "manage_nodes": "Beheer knooppunten", "etherscan_history": "Etherscan-geschiedenis", "template_name": "Sjabloonnaam", diff --git a/res/values/strings_pl.arb b/res/values/strings_pl.arb index 56871f242..593f5ae19 100644 --- a/res/values/strings_pl.arb +++ b/res/values/strings_pl.arb @@ -670,6 +670,12 @@ "balance_page": "Strona salda", "share": "Udział", "slidable": "Przesuwne", + "monero_dark_theme": "Ciemny motyw Monero", + "bitcoin_dark_theme": "Ciemny motyw Bitcoina", + "bitcoin_light_theme": "Lekki motyw Bitcoin", + "high_contrast_theme": "Motyw o wysokim kontraście", + "matrix_green_dark_theme": "Matrix Zielony ciemny motyw", + "monero_light_theme": "Lekki motyw Monero", "manage_nodes": "Zarządzaj węzłami", "etherscan_history": "Historia Etherscanu", "template_name": "Nazwa szablonu", diff --git a/res/values/strings_pt.arb b/res/values/strings_pt.arb index 7cccc3c9e..551c30d01 100644 --- a/res/values/strings_pt.arb +++ b/res/values/strings_pt.arb @@ -669,6 +669,12 @@ "balance_page": "Página de saldo", "share": "Compartilhar", "slidable": "Deslizável", + "monero_dark_theme": "Monero Tema Escuro", + "bitcoin_dark_theme": "Tema escuro Bitcoin", + "bitcoin_light_theme": "Tema claro de bitcoin", + "high_contrast_theme": "Tema de alto contraste", + "matrix_green_dark_theme": "Tema escuro verde matrix", + "monero_light_theme": "Monero Light Theme", "manage_nodes": "Gerenciar nós", "etherscan_history": "história Etherscan", "template_name": "Nome do modelo", diff --git a/res/values/strings_ru.arb b/res/values/strings_ru.arb index 40f9447ba..0d4c39570 100644 --- a/res/values/strings_ru.arb +++ b/res/values/strings_ru.arb @@ -670,6 +670,12 @@ "balance_page": "Страница баланса", "share": "Делиться", "slidable": "Скользящий", + "monero_dark_theme": "Темная тема Monero", + "bitcoin_dark_theme": "Биткойн Темная тема", + "bitcoin_light_theme": "Легкая биткойн-тема", + "high_contrast_theme": "Высококонтрастная тема", + "matrix_green_dark_theme": "Матрица Зеленая Темная Тема", + "monero_light_theme": "Светлая тема Monero", "manage_nodes": "Управление узлами", "etherscan_history": "История Эфириума", "template_name": "Имя Шаблона", @@ -679,4 +685,4 @@ "support_description_guides": "Документация и поддержка общих вопросов", "support_title_other_links": "Другие ссылки на поддержку", "support_description_other_links": "Присоединяйтесь к нашим сообществам или охватите нас наших партнеров с помощью других методов" -} \ No newline at end of file +} diff --git a/res/values/strings_th.arb b/res/values/strings_th.arb index 9ffd7af11..6522bc3d9 100644 --- a/res/values/strings_th.arb +++ b/res/values/strings_th.arb @@ -668,6 +668,12 @@ "balance_page": "หน้ายอดคงเหลือ", "share": "แบ่งปัน", "slidable": "เลื่อนได้", + "monero_dark_theme": "ธีมมืด Monero", + "bitcoin_dark_theme": "ธีมมืด Bitcoin", + "bitcoin_light_theme": "ธีมแสง Bitcoin", + "high_contrast_theme": "ธีมความคมชัดสูง", + "matrix_green_dark_theme": "ธีมเมทริกซ์สีเขียวเข้ม", + "monero_light_theme": "ธีมแสง Monero", "manage_nodes": "จัดการโหนด", "etherscan_history": "ประวัติอีเธอร์สแกน", "template_name": "ชื่อแม่แบบ", @@ -677,4 +683,4 @@ "support_description_guides": "เอกสารและการสนับสนุนสำหรับปัญหาทั่วไป", "support_title_other_links": "ลิงค์สนับสนุนอื่น ๆ", "support_description_other_links": "เข้าร่วมชุมชนของเราหรือเข้าถึงเราพันธมิตรของเราผ่านวิธีการอื่น ๆ" -} \ No newline at end of file +} diff --git a/res/values/strings_tr.arb b/res/values/strings_tr.arb index dedf7cf28..bb87595a4 100644 --- a/res/values/strings_tr.arb +++ b/res/values/strings_tr.arb @@ -669,6 +669,12 @@ "balance_page": "Bakiye Sayfası", "share": "Paylaşmak", "slidable": "kaydırılabilir", + "monero_dark_theme": "Monero Koyu Tema", + "bitcoin_dark_theme": "Bitcoin Karanlık Teması", + "bitcoin_light_theme": "Bitcoin Hafif Tema", + "high_contrast_theme": "Yüksek Kontrastlı Tema", + "matrix_green_dark_theme": "Matrix Yeşil Koyu Tema", + "monero_light_theme": "Monero Hafif Tema", "manage_nodes": "Düğümleri yönet", "etherscan_history": "Etherscan geçmişi", "template_name": "şablon adı", diff --git a/res/values/strings_uk.arb b/res/values/strings_uk.arb index f8a2777e5..d6e121279 100644 --- a/res/values/strings_uk.arb +++ b/res/values/strings_uk.arb @@ -670,6 +670,12 @@ "balance_page": "Сторінка балансу", "share": "Поділіться", "slidable": "Розсувний", + "monero_dark_theme": "Темна тема Monero", + "bitcoin_dark_theme": "Темна тема Bitcoin", + "bitcoin_light_theme": "Світла тема Bitcoin", + "high_contrast_theme": "Тема високої контрастності", + "matrix_green_dark_theme": "Зелена темна тема Matrix", + "monero_light_theme": "Легка тема Monero", "manage_nodes": "Керуйте вузлами", "etherscan_history": "Історія Etherscan", "template_name": "Назва шаблону", diff --git a/res/values/strings_ur.arb b/res/values/strings_ur.arb index 5eed0d35b..a24545501 100644 --- a/res/values/strings_ur.arb +++ b/res/values/strings_ur.arb @@ -662,6 +662,12 @@ "balance_page": "بیلنس صفحہ", "share": "بانٹیں", "slidable": "سلائیڈ ایبل", + "monero_dark_theme": "مونیرو ڈارک تھیم", + "bitcoin_dark_theme": "بٹ کوائن ڈارک تھیم", + "bitcoin_light_theme": "بٹ کوائن لائٹ تھیم", + "high_contrast_theme": "ہائی کنٹراسٹ تھیم", + "matrix_green_dark_theme": "میٹرکس گرین ڈارک تھیم", + "monero_light_theme": "مونیرو لائٹ تھیم", "manage_nodes": "۔ﮟﯾﺮﮐ ﻢﻈﻧ ﺎﮐ ﺱﮈﻮﻧ", "etherscan_history": "ﺦﯾﺭﺎﺗ ﯽﮐ ﻦﯿﮑﺳﺍ ﺮﮭﺘﯾﺍ", "template_name": "ٹیمپلیٹ کا نام", @@ -671,4 +677,4 @@ "support_description_guides": "عام مسائل کے لئے دستاویزات اور مدد", "support_title_other_links": "دوسرے سپورٹ لنکس", "support_description_other_links": "ہماری برادریوں میں شامل ہوں یا دوسرے طریقوں سے ہمارے شراکت داروں تک پہنچیں" -} \ No newline at end of file +} diff --git a/res/values/strings_yo.arb b/res/values/strings_yo.arb index c99b00ebd..d406aec86 100644 --- a/res/values/strings_yo.arb +++ b/res/values/strings_yo.arb @@ -672,5 +672,11 @@ "support_title_guides": "Akara oyinbo Awọn Itọsọna Awọki oyinbo", "support_description_guides": "Iwe ati atilẹyin fun awọn ọran ti o wọpọ", "support_title_other_links": "Awọn ọna asopọ atilẹyin miiran", - "support_description_other_links": "Darapọ mọ awọn agbegbe wa tabi de wa awọn alabaṣepọ wa nipasẹ awọn ọna miiran" -} \ No newline at end of file + "support_description_other_links": "Darapọ mọ awọn agbegbe wa tabi de wa awọn alabaṣepọ wa nipasẹ awọn ọna miiran", + "monero_dark_theme": "Monero Dudu Akori", + "bitcoin_dark_theme": "Bitcoin Dark Akori", + "bitcoin_light_theme": "Bitcoin Light Akori", + "high_contrast_theme": "Akori Iyatọ giga", + "matrix_green_dark_theme": "Matrix Green Dark Akori", + "monero_light_theme": "Monero Light Akori" +} diff --git a/res/values/strings_zh.arb b/res/values/strings_zh.arb index dc1cfd139..8e04bf2bc 100644 --- a/res/values/strings_zh.arb +++ b/res/values/strings_zh.arb @@ -677,5 +677,11 @@ "support_title_guides": "蛋糕钱包指南", "support_description_guides": "对常见问题的文档和支持", "support_title_other_links": "其他支持链接", - "support_description_other_links": "加入我们的社区或通过其他方法与我们联系我们的合作伙伴" -} \ No newline at end of file + "support_description_other_links": "加入我们的社区或通过其他方法与我们联系我们的合作伙伴", + "monero_dark_theme": "门罗币深色主题", + "bitcoin_dark_theme": "比特币黑暗主题", + "bitcoin_light_theme": "比特币浅色主题", + "high_contrast_theme": "高对比度主题", + "matrix_green_dark_theme": "矩阵绿暗主题", + "monero_light_theme": "门罗币浅色主题" +}