custom text button color

This commit is contained in:
julian 2023-02-10 15:16:32 -06:00
parent 30ec2cfcab
commit a75d5224e1
9 changed files with 54 additions and 3 deletions

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -59,6 +59,8 @@ class StackColors extends ThemeExtension<StackColors> {
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<StackColors> {
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<StackColors> {
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<StackColors> {
Color? numberTextDefault,
Color? numpadTextDefault,
Color? bottomNavText,
Color? customTextButtonEnabledText,
Color? customTextButtonDisabledText,
Color? switchBGOn,
Color? switchBGOff,
Color? switchBGDisabled,
@ -686,6 +694,10 @@ class StackColors extends ThemeExtension<StackColors> {
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<StackColors> {
other.bottomNavText,
t,
)!,
customTextButtonEnabledText: Color.lerp(
customTextButtonEnabledText,
other.customTextButtonEnabledText,
t,
)!,
customTextButtonDisabledText: Color.lerp(
customTextButtonDisabledText,
other.customTextButtonDisabledText,
t,
)!,
switchBGOn: Color.lerp(
switchBGOn,
other.switchBGOn,

View file

@ -134,9 +134,12 @@ class CustomTextButton extends StatelessWidget {
return _CustomTextButton(
key: UniqueKey(),
text: text,
enabledColor:
Theme.of(context).extension<StackColors>()!.buttonTextBorderless,
disabledColor: Theme.of(context).extension<StackColors>()!.textSubtitle1,
enabledColor: Theme.of(context)
.extension<StackColors>()!
.customTextButtonEnabledText,
disabledColor: Theme.of(context)
.extension<StackColors>()!
.customTextButtonDisabledText,
enabled: enabled,
textSize: textSize,
onTap: onTap,