From d3cb19cc3cb18760cf7353a17960b84068f81a2b Mon Sep 17 00:00:00 2001 From: Rafael Saes Date: Wed, 5 Jul 2023 15:10:45 -0300 Subject: [PATCH] refactor: move remaining items to CakeTextTheme and some missing fixes --- .../desktop_wallet_selection_dropdown.dart | 5 +-- .../dashboard/widgets/address_page.dart | 6 ++-- .../widgets/anonpay_transaction_row.dart | 3 +- .../dashboard/widgets/date_section_raw.dart | 6 ++-- .../screens/dashboard/widgets/order_row.dart | 6 ++-- .../screens/dashboard/widgets/trade_row.dart | 3 +- .../dashboard/widgets/transaction_raw.dart | 11 ++---- .../screens/disclaimer/disclaimer_page.dart | 2 +- lib/src/screens/send/send_page.dart | 10 ++---- .../widgets/settings_link_provider_cell.dart | 2 +- .../widgets/settings_picker_cell.dart | 3 +- lib/src/screens/setup_2fa/setup_2fa.dart | 5 +-- .../screens/setup_2fa/setup_2fa_qr_page.dart | 3 +- lib/src/widgets/standard_list.dart | 5 +-- lib/themes/bright_theme.dart | 25 ++++++------- lib/themes/dark_theme.dart | 24 ++++++------- lib/themes/extensions/cake_text_theme.dart | 21 ++++++++--- lib/themes/extensions/send_page_theme.dart | 26 ++++++++------ lib/themes/light_theme.dart | 35 +++++++------------ lib/themes/theme_base.dart | 5 ++- 20 files changed, 97 insertions(+), 109 deletions(-) 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 e02bcef85..ceb01f76a 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 @@ -6,6 +6,7 @@ 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'; @@ -94,8 +95,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/widgets/address_page.dart b/lib/src/screens/dashboard/widgets/address_page.dart index bba65e755..dc869f042 100644 --- a/lib/src/screens/dashboard/widgets/address_page.dart +++ b/lib/src/screens/dashboard/widgets/address_page.dart @@ -1,4 +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/anonpay/anonpay_donation_link_info.dart'; import 'package:cake_wallet/entities/preferences_key.dart'; import 'package:cake_wallet/entities/receive_page_option.dart'; @@ -188,10 +189,7 @@ class AddressPage extends BasePage { decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(25)), border: Border.all( - color: Theme.of(context) - .textTheme! - .titleMedium! - .color!, + color: Theme.of(context).extension()!.addressButtonBorderColor, width: 1), color: Theme.of(context).extension()!.syncedBackgroundColor), child: Row( diff --git a/lib/src/screens/dashboard/widgets/anonpay_transaction_row.dart b/lib/src/screens/dashboard/widgets/anonpay_transaction_row.dart index 2be9da4ba..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,5 @@ 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 { @@ -50,7 +51,7 @@ class AnonpayTransactionRow extends StatelessWidget { 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/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/order_row.dart b/lib/src/screens/dashboard/widgets/order_row.dart index fd941b416..8adc6e0d5 100644 --- a/lib/src/screens/dashboard/widgets/order_row.dart +++ b/lib/src/screens/dashboard/widgets/order_row.dart @@ -1,4 +1,5 @@ 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'; @@ -68,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/trade_row.dart b/lib/src/screens/dashboard/widgets/trade_row.dart index 8b0e107cc..a42593f24 100644 --- a/lib/src/screens/dashboard/widgets/trade_row.dart +++ b/lib/src/screens/dashboard/widgets/trade_row.dart @@ -1,3 +1,4 @@ +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'; @@ -60,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 2ad0e4bd3..3a95b9f2e 100644 --- a/lib/src/screens/dashboard/widgets/transaction_raw.dart +++ b/lib/src/screens/dashboard/widgets/transaction_raw.dart @@ -1,3 +1,4 @@ +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'; @@ -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/disclaimer/disclaimer_page.dart b/lib/src/screens/disclaimer/disclaimer_page.dart index b9223c2eb..3805f6240 100644 --- a/lib/src/screens/disclaimer/disclaimer_page.dart +++ b/lib/src/screens/disclaimer/disclaimer_page.dart @@ -157,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), diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart index 8b20286e6..c0a71f43b 100644 --- a/lib/src/screens/send/send_page.dart +++ b/lib/src/screens/send/send_page.dart @@ -198,14 +198,8 @@ class SendPage 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()!.templateBackgroundColor), ) : Offstage(); }, 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/setup_2fa/setup_2fa.dart b/lib/src/screens/setup_2fa/setup_2fa.dart index 5da0fb120..a3d0d7fe8 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_qr_page.dart b/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart index 91abd5f58..fa61f6fac 100644 --- a/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart +++ b/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/core/totp_request_details.dart'; +import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:cake_wallet/generated/i18n.dart'; @@ -51,7 +52,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( diff --git a/lib/src/widgets/standard_list.dart b/lib/src/widgets/standard_list.dart index 2e0c9bebf..2ea874d52 100644 --- a/lib/src/widgets/standard_list.dart +++ b/lib/src/widgets/standard_list.dart @@ -84,10 +84,7 @@ class StandardListSeparator extends StatelessWidget { color: Theme.of(context).colorScheme.background, child: Container( height: height, - color: Theme.of(context) - .primaryTextTheme! - .titleLarge - ?.backgroundColor)); + color: Theme.of(context).extension()!.textfieldUnderlineColor)); } } diff --git a/lib/themes/bright_theme.dart b/lib/themes/bright_theme.dart index 9891d3b06..c049438ab 100644 --- a/lib/themes/bright_theme.dart +++ b/lib/themes/bright_theme.dart @@ -1,4 +1,5 @@ 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'; @@ -7,6 +8,8 @@ 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'; @@ -84,7 +87,7 @@ class BrightTheme extends LightTheme { @override SendPageTheme get sendPageTheme => super.sendPageTheme.copyWith( templateBackgroundColor: Palette.shadowWhite, - templateDotterBorderColor: Palette.shadowWhite, + templateDottedBorderColor: Palette.shadowWhite, secondGradientColor: Palette.pinkFlamingo); @override @@ -110,22 +113,14 @@ class BrightTheme extends LightTheme { .qrCodeTheme .copyWith(qrWidgetCopyButtonColor: Colors.white.withOpacity(0.4)); + @override + CakeTextTheme get cakeTextTheme => super.cakeTextTheme.copyWith( + addressButtonBorderColor: Colors.white.withOpacity(0.4), + dateSectionRowColor: Colors.white.withOpacity(0.5)); + @override ThemeData get themeData => super.themeData.copyWith( indicatorColor: Colors.white.withOpacity(0.5), // page indicator dividerColor: Palette.paleBlue, - hintColor: Palette.gray, - textTheme: TextTheme( - labelSmall: TextStyle( - backgroundColor: - Colors.white.withOpacity(0.5), // date section row - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: Colors.white.withOpacity(0.2), // address button border - decorationColor: - Colors.white.withOpacity(0.4), // copy button (qr widget) - ), - ), - ); + hintColor: Palette.gray); } diff --git a/lib/themes/dark_theme.dart b/lib/themes/dark_theme.dart index 98effdc18..61c05bf6c 100644 --- a/lib/themes/dark_theme.dart +++ b/lib/themes/dark_theme.dart @@ -1,3 +1,4 @@ +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'; @@ -15,6 +16,8 @@ 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'; @@ -153,7 +156,8 @@ class DarkTheme extends ThemeBase { textFieldHintColor: PaletteDark.darkCyanBlue, textFieldBorderColor: PaletteDark.lightVioletBlue, secondGradientColor: PaletteDark.darkNightBlue, - firstGradientColor: PaletteDark.darkNightBlue); + firstGradientColor: PaletteDark.darkNightBlue, + indicatorDotColor: PaletteDark.cyanBlue); @override SeedWidgetTheme get seedWidgetTheme => @@ -171,7 +175,9 @@ class DarkTheme extends ThemeBase { CakeTextTheme get cakeTextTheme => CakeTextTheme( secondaryTextColor: PaletteDark.darkCyanBlue, textfieldUnderlineColor: PaletteDark.darkOceanBlue, - titleColor: Colors.white); + titleColor: Colors.white, + addressButtonBorderColor: PaletteDark.nightBlue, + dateSectionRowColor: PaletteDark.darkCyanBlue); @override AccountListTheme get accountListTheme => AccountListTheme( @@ -196,22 +202,12 @@ class DarkTheme extends ThemeBase { @override ThemeData get themeData => super.themeData.copyWith( - indicatorColor: PaletteDark.cyanBlue, // page indicator + indicatorColor: PaletteDark.cyanBlue, dividerColor: PaletteDark.dividerColor, hintColor: PaletteDark.pigeonBlue, disabledColor: PaletteDark.deepVioletBlue, dialogTheme: super .themeData .dialogTheme - .copyWith(backgroundColor: PaletteDark.nightBlue), - textTheme: TextTheme( - labelSmall: TextStyle( - backgroundColor: PaletteDark.darkCyanBlue, // date section row - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: PaletteDark.nightBlue, // address button border - ), - ), - ); + .copyWith(backgroundColor: PaletteDark.nightBlue)); } diff --git a/lib/themes/extensions/cake_text_theme.dart b/lib/themes/extensions/cake_text_theme.dart index 30337252a..3a2d9c6e1 100644 --- a/lib/themes/extensions/cake_text_theme.dart +++ b/lib/themes/extensions/cake_text_theme.dart @@ -4,22 +4,31 @@ class CakeTextTheme extends ThemeExtension { final Color secondaryTextColor; final Color textfieldUnderlineColor; final Color titleColor; + final Color addressButtonBorderColor; + final Color dateSectionRowColor; CakeTextTheme( {required this.secondaryTextColor, required this.textfieldUnderlineColor, - required this.titleColor}); + required this.titleColor, + required this.addressButtonBorderColor, + required this.dateSectionRowColor}); @override CakeTextTheme copyWith( {Color? secondaryTextColor, Color? textfieldUnderlineColor, - Color? titleColor}) => + Color? titleColor, + Color? addressButtonBorderColor, + Color? dateSectionRowColor}) => CakeTextTheme( secondaryTextColor: secondaryTextColor ?? this.secondaryTextColor, textfieldUnderlineColor: textfieldUnderlineColor ?? this.textfieldUnderlineColor, - titleColor: titleColor ?? this.titleColor); + titleColor: titleColor ?? this.titleColor, + addressButtonBorderColor: + addressButtonBorderColor ?? this.addressButtonBorderColor, + dateSectionRowColor: dateSectionRowColor ?? this.dateSectionRowColor); @override CakeTextTheme lerp(ThemeExtension? other, double t) { @@ -32,6 +41,10 @@ class CakeTextTheme extends ThemeExtension { Color.lerp(secondaryTextColor, other.secondaryTextColor, t)!, textfieldUnderlineColor: Color.lerp( textfieldUnderlineColor, other.textfieldUnderlineColor, t)!, - titleColor: Color.lerp(titleColor, other.titleColor, t)!); + titleColor: Color.lerp(titleColor, other.titleColor, t)!, + addressButtonBorderColor: Color.lerp( + addressButtonBorderColor, other.addressButtonBorderColor, t)!, + dateSectionRowColor: + Color.lerp(dateSectionRowColor, other.dateSectionRowColor, t)!); } } diff --git a/lib/themes/extensions/send_page_theme.dart b/lib/themes/extensions/send_page_theme.dart index 6287a1670..637738e79 100644 --- a/lib/themes/extensions/send_page_theme.dart +++ b/lib/themes/extensions/send_page_theme.dart @@ -12,6 +12,7 @@ class SendPageTheme extends ThemeExtension { final Color textFieldBorderColor; final Color firstGradientColor; final Color secondGradientColor; + final Color indicatorDotColor; SendPageTheme( {required this.templateTitleColor, @@ -24,21 +25,23 @@ class SendPageTheme extends ThemeExtension { required this.textFieldHintColor, required this.textFieldBorderColor, required this.firstGradientColor, - required this.secondGradientColor}); + required this.secondGradientColor, + required this.indicatorDotColor}); @override SendPageTheme copyWith( {Color? templateTitleColor, Color? templateBackgroundColor, Color? templateNewTextColor, - Color? templateDotterBorderColor, + Color? templateDottedBorderColor, Color? estimatedFeeColor, Color? textFieldButtonIconColor, Color? textFieldButtonColor, Color? textFieldHintColor, Color? textFieldBorderColor, Color? firstGradientColor, - Color? secondGradientColor}) => + Color? secondGradientColor, + Color? indicatorDotColor}) => SendPageTheme( templateTitleColor: templateTitleColor ?? this.templateTitleColor, templateBackgroundColor: @@ -46,7 +49,7 @@ class SendPageTheme extends ThemeExtension { templateNewTextColor: templateNewTextColor ?? this.templateNewTextColor, templateDottedBorderColor: - templateDotterBorderColor ?? this.templateDottedBorderColor, + templateDottedBorderColor ?? this.templateDottedBorderColor, estimatedFeeColor: estimatedFeeColor ?? this.estimatedFeeColor, textFieldButtonIconColor: textFieldButtonIconColor ?? this.textFieldButtonIconColor, @@ -56,7 +59,8 @@ class SendPageTheme extends ThemeExtension { textFieldBorderColor: textFieldBorderColor ?? this.textFieldBorderColor, firstGradientColor: firstGradientColor ?? this.firstGradientColor, - secondGradientColor: secondGradientColor ?? this.secondGradientColor); + secondGradientColor: secondGradientColor ?? this.secondGradientColor, + indicatorDotColor: indicatorDotColor ?? this.indicatorDotColor); @override SendPageTheme lerp(ThemeExtension? other, double t) { @@ -65,16 +69,14 @@ class SendPageTheme extends ThemeExtension { } return SendPageTheme( - templateTitleColor: Color.lerp( - templateTitleColor, other.templateTitleColor, t)!, + templateTitleColor: + Color.lerp(templateTitleColor, other.templateTitleColor, t)!, templateBackgroundColor: Color.lerp( templateBackgroundColor, other.templateBackgroundColor, t)!, templateNewTextColor: Color.lerp(templateNewTextColor, other.templateNewTextColor, t)!, templateDottedBorderColor: Color.lerp( - templateDottedBorderColor, - other.templateDottedBorderColor, - t)!, + templateDottedBorderColor, other.templateDottedBorderColor, t)!, estimatedFeeColor: Color.lerp(estimatedFeeColor, other.estimatedFeeColor, t)!, textFieldButtonIconColor: Color.lerp( @@ -88,6 +90,8 @@ class SendPageTheme extends ThemeExtension { firstGradientColor: Color.lerp(firstGradientColor, other.firstGradientColor, t)!, secondGradientColor: - Color.lerp(secondGradientColor, other.secondGradientColor, t)!); + Color.lerp(secondGradientColor, other.secondGradientColor, t)!, + indicatorDotColor: + Color.lerp(indicatorDotColor, other.indicatorDotColor, t)!); } } diff --git a/lib/themes/light_theme.dart b/lib/themes/light_theme.dart index d299fc184..f00d88515 100644 --- a/lib/themes/light_theme.dart +++ b/lib/themes/light_theme.dart @@ -1,3 +1,4 @@ +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'; @@ -15,6 +16,8 @@ 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'; @@ -64,8 +67,7 @@ class LightTheme extends ThemeBase { @override PinCodeTheme get pinCodeTheme => PinCodeTheme( - indicatorsColor: Palette.darkGray, - switchColor: Palette.darkGray); + indicatorsColor: Palette.darkGray, switchColor: Palette.darkGray); @override SupportPageTheme get supportPageTheme => @@ -154,7 +156,8 @@ class LightTheme extends ThemeBase { textFieldHintColor: Colors.white.withOpacity(0.5), textFieldBorderColor: Colors.white.withOpacity(0.5), secondGradientColor: Palette.blueGreyCraiola, - firstGradientColor: Palette.blueCraiola); + firstGradientColor: Palette.blueCraiola, + indicatorDotColor: PaletteDark.darkCyanBlue.withOpacity(0.67)); @override SeedWidgetTheme get seedWidgetTheme => @@ -166,19 +169,19 @@ class LightTheme extends ThemeBase { @override TransactionTradeTheme get transactionTradeTheme => TransactionTradeTheme( - detailsTitlesColor: Palette.darkGray, - rowsColor: Palette.blueAlice); + detailsTitlesColor: Palette.darkGray, rowsColor: Palette.blueAlice); @override CakeTextTheme get cakeTextTheme => CakeTextTheme( secondaryTextColor: PaletteDark.pigeonBlue, textfieldUnderlineColor: Palette.wildPeriwinkle, - titleColor: Palette.violetBlue); + titleColor: Palette.violetBlue, + addressButtonBorderColor: Palette.blueAlice, + dateSectionRowColor: PaletteDark.darkCyanBlue); @override AccountListTheme get accountListTheme => AccountListTheme( - tilesBackgroundColor: Colors.white, - tilesTextColor: Palette.violetBlue); + tilesBackgroundColor: Colors.white, tilesTextColor: Palette.violetBlue); @override ReceivePageTheme get receivePageTheme => ReceivePageTheme( @@ -203,18 +206,6 @@ class LightTheme extends ThemeBase { dividerColor: Palette.paleBlue, hintColor: Palette.gray, disabledColor: Palette.darkGray, - dialogTheme: super - .themeData - .dialogTheme - .copyWith(backgroundColor: Colors.white), - textTheme: TextTheme( - labelSmall: TextStyle( - backgroundColor: PaletteDark.darkCyanBlue, // date section row - ), - // subhead -> titleMedium - titleMedium: TextStyle( - color: Palette.blueAlice, // address button border - ), - ), - ); + dialogTheme: + super.themeData.dialogTheme.copyWith(backgroundColor: Colors.white)); } diff --git a/lib/themes/theme_base.dart b/lib/themes/theme_base.dart index 75fd9e501..fa1ad675b 100644 --- a/lib/themes/theme_base.dart +++ b/lib/themes/theme_base.dart @@ -1,3 +1,4 @@ +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'; @@ -14,6 +15,8 @@ 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'; @@ -22,7 +25,7 @@ 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});