From 9f5ce0db7aeca057938faed9b5d0aacee69e7f1a Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Tue, 10 Jan 2023 15:28:59 -0700 Subject: [PATCH] textRestore added for color fix --- .../restore_wallet_view.dart | 21 ++++++++++++------- lib/utilities/theme/color_theme.dart | 1 + lib/utilities/theme/dark_colors.dart | 2 ++ lib/utilities/theme/light_colors.dart | 2 ++ lib/utilities/theme/ocean_breeze_colors.dart | 2 ++ lib/utilities/theme/oled_black_colors.dart | 2 ++ lib/utilities/theme/stack_colors.dart | 10 +++++++++ 7 files changed, 33 insertions(+), 7 deletions(-) diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart index bb2628192..44a00083f 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart @@ -373,17 +373,22 @@ class _RestoreWalletViewState extends ConsumerState { FormInputStatus status, String prefix) { Color color; Color prefixColor; + Color borderColor; Widget? suffixIcon; switch (status) { case FormInputStatus.empty: color = Theme.of(context).extension()!.textFieldDefaultBG; prefixColor = Theme.of(context).extension()!.textSubtitle2; + borderColor = + Theme.of(context).extension()!.textFieldDefaultBG; break; case FormInputStatus.invalid: color = Theme.of(context).extension()!.textFieldErrorBG; prefixColor = Theme.of(context) .extension()! .textFieldErrorSearchIconLeft; + borderColor = + Theme.of(context).extension()!.textFieldErrorBorder; suffixIcon = SvgPicture.asset( Assets.svg.alertCircle, width: 16, @@ -398,6 +403,8 @@ class _RestoreWalletViewState extends ConsumerState { prefixColor = Theme.of(context) .extension()! .textFieldSuccessSearchIconLeft; + borderColor = + Theme.of(context).extension()!.textFieldSuccessBorder; suffixIcon = SvgPicture.asset( Assets.svg.checkCircle, width: 16, @@ -449,11 +456,11 @@ class _RestoreWalletViewState extends ConsumerState { child: suffixIcon, ), ), - enabledBorder: _buildOutlineInputBorder(color), - focusedBorder: _buildOutlineInputBorder(color), - errorBorder: _buildOutlineInputBorder(color), - disabledBorder: _buildOutlineInputBorder(color), - focusedErrorBorder: _buildOutlineInputBorder(color), + enabledBorder: _buildOutlineInputBorder(borderColor), + focusedBorder: _buildOutlineInputBorder(borderColor), + errorBorder: _buildOutlineInputBorder(borderColor), + disabledBorder: _buildOutlineInputBorder(borderColor), + focusedErrorBorder: _buildOutlineInputBorder(borderColor), ); } @@ -786,7 +793,7 @@ class _RestoreWalletViewState extends ConsumerState { .copyWith( color: Theme.of(context) .extension()! - .overlay, + .textRestore, fontSize: isDesktop ? 16 : 14, ), ), @@ -993,7 +1000,7 @@ class _RestoreWalletViewState extends ConsumerState { STextStyles.field(context).copyWith( color: Theme.of(context) .extension()! - .overlay, + .textRestore, fontSize: isDesktop ? 16 : 14, ), ), diff --git a/lib/utilities/theme/color_theme.dart b/lib/utilities/theme/color_theme.dart index c9853891f..8e85a69c1 100644 --- a/lib/utilities/theme/color_theme.dart +++ b/lib/utilities/theme/color_theme.dart @@ -68,6 +68,7 @@ abstract class StackColorTheme { Color get textWhite; Color get textFavoriteCard; Color get textError; + Color get textRestore; // button background Color get buttonBackPrimary; diff --git a/lib/utilities/theme/dark_colors.dart b/lib/utilities/theme/dark_colors.dart index eae8fa5a8..9e3a625c1 100644 --- a/lib/utilities/theme/dark_colors.dart +++ b/lib/utilities/theme/dark_colors.dart @@ -55,6 +55,8 @@ class DarkColors extends StackColorTheme { Color get textFavoriteCard => const Color(0xFF232323); @override Color get textError => const Color(0xFFF37475); + @override + Color get textRestore => overlay; // button background @override diff --git a/lib/utilities/theme/light_colors.dart b/lib/utilities/theme/light_colors.dart index 27e1edd71..ef59ed622 100644 --- a/lib/utilities/theme/light_colors.dart +++ b/lib/utilities/theme/light_colors.dart @@ -55,6 +55,8 @@ class LightColors extends StackColorTheme { Color get textFavoriteCard => const Color(0xFF232323); @override Color get textError => const Color(0xFF930006); + @override + Color get textRestore => overlay; // button background @override diff --git a/lib/utilities/theme/ocean_breeze_colors.dart b/lib/utilities/theme/ocean_breeze_colors.dart index 9e010dfd3..8bc9dab52 100644 --- a/lib/utilities/theme/ocean_breeze_colors.dart +++ b/lib/utilities/theme/ocean_breeze_colors.dart @@ -62,6 +62,8 @@ class OceanBreezeColors extends StackColorTheme { Color get textFavoriteCard => const Color(0xFF232323); @override Color get textError => const Color(0xFF8D0006); + @override + Color get textRestore => overlay; // button background @override diff --git a/lib/utilities/theme/oled_black_colors.dart b/lib/utilities/theme/oled_black_colors.dart index 41b43c3e6..5a878d7c6 100644 --- a/lib/utilities/theme/oled_black_colors.dart +++ b/lib/utilities/theme/oled_black_colors.dart @@ -56,6 +56,8 @@ class OledBlackColors extends StackColorTheme { Color get textFavoriteCard => const Color(0xFF232323); @override Color get textError => const Color(0xFFCF6679); + @override + Color get textRestore => textDark; // button background @override diff --git a/lib/utilities/theme/stack_colors.dart b/lib/utilities/theme/stack_colors.dart index 9aaa6072d..b47e93128 100644 --- a/lib/utilities/theme/stack_colors.dart +++ b/lib/utilities/theme/stack_colors.dart @@ -32,6 +32,7 @@ class StackColors extends ThemeExtension { final Color textWhite; final Color textFavoriteCard; final Color textError; + final Color textRestore; // button background final Color buttonBackPrimary; @@ -200,6 +201,7 @@ class StackColors extends ThemeExtension { required this.textWhite, required this.textFavoriteCard, required this.textError, + required this.textRestore, required this.buttonBackPrimary, required this.buttonBackSecondary, required this.buttonBackPrimaryDisabled, @@ -338,6 +340,7 @@ class StackColors extends ThemeExtension { textWhite: colorTheme.textWhite, textFavoriteCard: colorTheme.textFavoriteCard, textError: colorTheme.textError, + textRestore: colorTheme.textRestore, buttonBackPrimary: colorTheme.buttonBackPrimary, buttonBackSecondary: colorTheme.buttonBackSecondary, buttonBackPrimaryDisabled: colorTheme.buttonBackPrimaryDisabled, @@ -479,6 +482,7 @@ class StackColors extends ThemeExtension { Color? textWhite, Color? textFavoriteCard, Color? textError, + Color? textRestore, Color? buttonBackPrimary, Color? buttonBackSecondary, Color? buttonBackPrimaryDisabled, @@ -615,6 +619,7 @@ class StackColors extends ThemeExtension { textWhite: textWhite ?? this.textWhite, textFavoriteCard: textFavoriteCard ?? this.textFavoriteCard, textError: textError ?? this.textError, + textRestore: textRestore ?? this.textRestore, buttonBackPrimary: buttonBackPrimary ?? this.buttonBackPrimary, buttonBackSecondary: buttonBackSecondary ?? this.buttonBackSecondary, buttonBackPrimaryDisabled: @@ -888,6 +893,11 @@ class StackColors extends ThemeExtension { other.textError, t, )!, + textRestore: Color.lerp( + textRestore, + other.textRestore, + t, + )!, buttonBackPrimary: Color.lerp( buttonBackPrimary, other.buttonBackPrimary,