From 64420962f280d03902598b63751691075d20d954 Mon Sep 17 00:00:00 2001 From: julian Date: Sun, 25 Sep 2022 08:28:21 -0600 Subject: [PATCH] mnemonic word game selected text dark theme color fix --- .../sub_widgets/word_table_item.dart | 19 ++++++++++++++++--- lib/utilities/theme/color_theme.dart | 1 + lib/utilities/theme/dark_colors.dart | 2 ++ lib/utilities/theme/light_colors.dart | 2 ++ lib/utilities/theme/stack_colors.dart | 11 +++++++++++ 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart b/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart index 1cdc1a4f8..9f8f43b59 100644 --- a/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart +++ b/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart @@ -56,10 +56,23 @@ class WordTableItem extends ConsumerWidget { textAlign: TextAlign.center, style: isDesktop ? STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of(context).extension()!.textDark, + color: selectedWord == word + ? Theme.of(context) + .extension()! + .textSelectedWordTableItem + : Theme.of(context) + .extension()! + .textDark, ) - : STextStyles.baseXS(context), + : STextStyles.baseXS(context).copyWith( + color: selectedWord == word + ? Theme.of(context) + .extension()! + .textSelectedWordTableItem + : Theme.of(context) + .extension()! + .textDark, + ), ), ], ), diff --git a/lib/utilities/theme/color_theme.dart b/lib/utilities/theme/color_theme.dart index 0ee4b2d70..9ab9aa293 100644 --- a/lib/utilities/theme/color_theme.dart +++ b/lib/utilities/theme/color_theme.dart @@ -174,6 +174,7 @@ abstract class StackColorTheme { Color get loadingOverlayTextColor; Color get myStackContactIconBG; Color get textConfirmTotalAmount; + Color get textSelectedWordTableItem; } class CoinThemeColor { diff --git a/lib/utilities/theme/dark_colors.dart b/lib/utilities/theme/dark_colors.dart index b28880da8..e7c4e51db 100644 --- a/lib/utilities/theme/dark_colors.dart +++ b/lib/utilities/theme/dark_colors.dart @@ -301,4 +301,6 @@ class DarkColors extends StackColorTheme { Color get myStackContactIconBG => const Color(0x88747778); @override Color get textConfirmTotalAmount => const Color(0xFF003921); + @override + Color get textSelectedWordTableItem => const Color(0xFF00297A); } diff --git a/lib/utilities/theme/light_colors.dart b/lib/utilities/theme/light_colors.dart index 4c7ac7ab4..ea3a7cb92 100644 --- a/lib/utilities/theme/light_colors.dart +++ b/lib/utilities/theme/light_colors.dart @@ -301,4 +301,6 @@ class LightColors extends StackColorTheme { Color get myStackContactIconBG => textFieldDefaultBG; @override Color get textConfirmTotalAmount => const Color(0xFF232323); + @override + Color get textSelectedWordTableItem => const Color(0xFF232323); } diff --git a/lib/utilities/theme/stack_colors.dart b/lib/utilities/theme/stack_colors.dart index 6116615c4..e8b846490 100644 --- a/lib/utilities/theme/stack_colors.dart +++ b/lib/utilities/theme/stack_colors.dart @@ -169,6 +169,7 @@ class StackColors extends ThemeExtension { final Color loadingOverlayTextColor; final Color myStackContactIconBG; final Color textConfirmTotalAmount; + final Color textSelectedWordTableItem; StackColors({ required this.themeType, @@ -300,6 +301,7 @@ class StackColors extends ThemeExtension { required this.loadingOverlayTextColor, required this.myStackContactIconBG, required this.textConfirmTotalAmount, + required this.textSelectedWordTableItem, }); factory StackColors.fromStackColorTheme(StackColorTheme colorTheme) { @@ -435,6 +437,7 @@ class StackColors extends ThemeExtension { loadingOverlayTextColor: colorTheme.loadingOverlayTextColor, myStackContactIconBG: colorTheme.myStackContactIconBG, textConfirmTotalAmount: colorTheme.textConfirmTotalAmount, + textSelectedWordTableItem: colorTheme.textSelectedWordTableItem, ); } @@ -569,6 +572,7 @@ class StackColors extends ThemeExtension { Color? loadingOverlayTextColor, Color? myStackContactIconBG, Color? textConfirmTotalAmount, + Color? textSelectedWordTableItem, }) { return StackColors( themeType: themeType ?? this.themeType, @@ -736,6 +740,8 @@ class StackColors extends ThemeExtension { myStackContactIconBG: myStackContactIconBG ?? this.myStackContactIconBG, textConfirmTotalAmount: textConfirmTotalAmount ?? this.textConfirmTotalAmount, + textSelectedWordTableItem: + textSelectedWordTableItem ?? this.textSelectedWordTableItem, ); } @@ -1388,6 +1394,11 @@ class StackColors extends ThemeExtension { other.textConfirmTotalAmount, t, )!, + textSelectedWordTableItem: Color.lerp( + textSelectedWordTableItem, + other.textSelectedWordTableItem, + t, + )!, ); }