From a75d5224e12edc4aa800de4b76ad9f3c0552862b Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 10 Feb 2023 15:16:32 -0600 Subject: [PATCH] custom text button color --- lib/utilities/theme/color_theme.dart | 2 ++ lib/utilities/theme/dark_colors.dart | 4 ++++ lib/utilities/theme/forest_colors.dart | 4 ++++ lib/utilities/theme/fruit_sorbet_colors.dart | 4 ++++ lib/utilities/theme/light_colors.dart | 4 ++++ lib/utilities/theme/ocean_breeze_colors.dart | 4 ++++ lib/utilities/theme/oled_black_colors.dart | 4 ++++ lib/utilities/theme/stack_colors.dart | 22 +++++++++++++++++++ .../custom_buttons/blue_text_button.dart | 9 +++++--- 9 files changed, 54 insertions(+), 3 deletions(-) diff --git a/lib/utilities/theme/color_theme.dart b/lib/utilities/theme/color_theme.dart index 1e7b3ab82..713e186d1 100644 --- a/lib/utilities/theme/color_theme.dart +++ b/lib/utilities/theme/color_theme.dart @@ -105,6 +105,8 @@ abstract class StackColorTheme { Color get numberTextDefault; Color get numpadTextDefault; Color get bottomNavText; + Color get customTextButtonEnabledText; + Color get customTextButtonDisabledText; // switch background Color get switchBGOn; diff --git a/lib/utilities/theme/dark_colors.dart b/lib/utilities/theme/dark_colors.dart index 802717f7f..e91c7d126 100644 --- a/lib/utilities/theme/dark_colors.dart +++ b/lib/utilities/theme/dark_colors.dart @@ -106,6 +106,10 @@ class DarkColors extends StackColorTheme { Color get numpadTextDefault => const Color(0xFFFFFFFF); @override Color get bottomNavText => const Color(0xFFFFFFFF); + @override + Color get customTextButtonEnabledText => buttonTextBorderless; + @override + Color get customTextButtonDisabledText => textSubtitle1; // switch @override diff --git a/lib/utilities/theme/forest_colors.dart b/lib/utilities/theme/forest_colors.dart index ad4942a80..62e7f029a 100644 --- a/lib/utilities/theme/forest_colors.dart +++ b/lib/utilities/theme/forest_colors.dart @@ -106,6 +106,10 @@ class ForestColors extends StackColorTheme { Color get numpadTextDefault => const Color(0xFFFFFFFF); @override Color get bottomNavText => const Color(0xFF232323); + @override + Color get customTextButtonEnabledText => infoItemIcons; + @override + Color get customTextButtonDisabledText => textSubtitle1; // switch @override diff --git a/lib/utilities/theme/fruit_sorbet_colors.dart b/lib/utilities/theme/fruit_sorbet_colors.dart index 3394b3a9c..ef021fad1 100644 --- a/lib/utilities/theme/fruit_sorbet_colors.dart +++ b/lib/utilities/theme/fruit_sorbet_colors.dart @@ -82,6 +82,10 @@ class FruitSorbetColors extends StackColorTheme { Color get numpadBackDefault => const Color(0xFFF95369); @override Color get bottomNavBack => const Color(0xFFFFFFFF); + @override + Color get customTextButtonEnabledText => buttonTextBorderless; + @override + Color get customTextButtonDisabledText => textSubtitle1; // button text/element @override diff --git a/lib/utilities/theme/light_colors.dart b/lib/utilities/theme/light_colors.dart index b4d66d7f3..8c9b4dcc5 100644 --- a/lib/utilities/theme/light_colors.dart +++ b/lib/utilities/theme/light_colors.dart @@ -106,6 +106,10 @@ class LightColors extends StackColorTheme { Color get numpadTextDefault => const Color(0xFFFFFFFF); @override Color get bottomNavText => const Color(0xFF232323); + @override + Color get customTextButtonEnabledText => buttonTextBorderless; + @override + Color get customTextButtonDisabledText => textSubtitle1; // switch @override diff --git a/lib/utilities/theme/ocean_breeze_colors.dart b/lib/utilities/theme/ocean_breeze_colors.dart index f8bcaf0c1..51831f2e5 100644 --- a/lib/utilities/theme/ocean_breeze_colors.dart +++ b/lib/utilities/theme/ocean_breeze_colors.dart @@ -113,6 +113,10 @@ class OceanBreezeColors extends StackColorTheme { Color get numpadTextDefault => const Color(0xFFFFFFFF); @override Color get bottomNavText => const Color(0xFF232323); + @override + Color get customTextButtonEnabledText => buttonTextBorderless; + @override + Color get customTextButtonDisabledText => textSubtitle1; // switch @override diff --git a/lib/utilities/theme/oled_black_colors.dart b/lib/utilities/theme/oled_black_colors.dart index 84e2a7f96..97fd6ad5f 100644 --- a/lib/utilities/theme/oled_black_colors.dart +++ b/lib/utilities/theme/oled_black_colors.dart @@ -107,6 +107,10 @@ class OledBlackColors extends StackColorTheme { Color get numpadTextDefault => const Color(0xFF000000); @override Color get bottomNavText => const Color(0xFFDEDEDE); + @override + Color get customTextButtonEnabledText => buttonTextBorderless; + @override + Color get customTextButtonDisabledText => textSubtitle1; // switch @override diff --git a/lib/utilities/theme/stack_colors.dart b/lib/utilities/theme/stack_colors.dart index e9280fee5..bc26c3f80 100644 --- a/lib/utilities/theme/stack_colors.dart +++ b/lib/utilities/theme/stack_colors.dart @@ -59,6 +59,8 @@ class StackColors extends ThemeExtension { final Color numberTextDefault; final Color numpadTextDefault; final Color bottomNavText; + final Color customTextButtonEnabledText; + final Color customTextButtonDisabledText; // switch background final Color switchBGOn; @@ -235,6 +237,8 @@ class StackColors extends ThemeExtension { required this.numberTextDefault, required this.numpadTextDefault, required this.bottomNavText, + required this.customTextButtonEnabledText, + required this.customTextButtonDisabledText, required this.switchBGOn, required this.switchBGOff, required this.switchBGDisabled, @@ -383,6 +387,8 @@ class StackColors extends ThemeExtension { numberTextDefault: colorTheme.numberTextDefault, numpadTextDefault: colorTheme.numpadTextDefault, bottomNavText: colorTheme.bottomNavText, + customTextButtonEnabledText: colorTheme.customTextButtonEnabledText, + customTextButtonDisabledText: colorTheme.customTextButtonDisabledText, switchBGOn: colorTheme.switchBGOn, switchBGOff: colorTheme.switchBGOff, switchBGDisabled: colorTheme.switchBGDisabled, @@ -533,6 +539,8 @@ class StackColors extends ThemeExtension { Color? numberTextDefault, Color? numpadTextDefault, Color? bottomNavText, + Color? customTextButtonEnabledText, + Color? customTextButtonDisabledText, Color? switchBGOn, Color? switchBGOff, Color? switchBGDisabled, @@ -686,6 +694,10 @@ class StackColors extends ThemeExtension { numberTextDefault: numberTextDefault ?? this.numberTextDefault, numpadTextDefault: numpadTextDefault ?? this.numpadTextDefault, bottomNavText: bottomNavText ?? this.bottomNavText, + customTextButtonEnabledText: + customTextButtonEnabledText ?? this.customTextButtonEnabledText, + customTextButtonDisabledText: + customTextButtonDisabledText ?? this.customTextButtonDisabledText, switchBGOn: switchBGOn ?? this.switchBGOn, switchBGOff: switchBGOff ?? this.switchBGOff, switchBGDisabled: switchBGDisabled ?? this.switchBGDisabled, @@ -1061,6 +1073,16 @@ class StackColors extends ThemeExtension { other.bottomNavText, t, )!, + customTextButtonEnabledText: Color.lerp( + customTextButtonEnabledText, + other.customTextButtonEnabledText, + t, + )!, + customTextButtonDisabledText: Color.lerp( + customTextButtonDisabledText, + other.customTextButtonDisabledText, + t, + )!, switchBGOn: Color.lerp( switchBGOn, other.switchBGOn, diff --git a/lib/widgets/custom_buttons/blue_text_button.dart b/lib/widgets/custom_buttons/blue_text_button.dart index 8be6bb937..213dc55cc 100644 --- a/lib/widgets/custom_buttons/blue_text_button.dart +++ b/lib/widgets/custom_buttons/blue_text_button.dart @@ -134,9 +134,12 @@ class CustomTextButton extends StatelessWidget { return _CustomTextButton( key: UniqueKey(), text: text, - enabledColor: - Theme.of(context).extension()!.buttonTextBorderless, - disabledColor: Theme.of(context).extension()!.textSubtitle1, + enabledColor: Theme.of(context) + .extension()! + .customTextButtonEnabledText, + disabledColor: Theme.of(context) + .extension()! + .customTextButtonDisabledText, enabled: enabled, textSize: textSize, onTap: onTap,