From 8e2befaf3da1a7199d2e388705e60f75fa4c7024 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Wed, 19 Nov 2025 19:19:04 +0100 Subject: [PATCH] Fixed button color problem --- .../widgets/buttons/custom_width_button.dart | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/presentation/widgets/buttons/custom_width_button.dart b/lib/presentation/widgets/buttons/custom_width_button.dart index bce78ed..17c9dc5 100644 --- a/lib/presentation/widgets/buttons/custom_width_button.dart +++ b/lib/presentation/widgets/buttons/custom_width_button.dart @@ -26,11 +26,13 @@ class CustomWidthButton extends StatelessWidget { if (buttonType == ButtonType.primary) { textcolor = Colors.white; - disabledTextColor = Colors.white.withValues(alpha: 0.24); + disabledTextColor = Color.lerp(textcolor, Colors.black, 0.5)!; buttonBackgroundColor = CustomTheme.primaryColor; - disabledBackgroundColor = CustomTheme.primaryColor.withValues( - alpha: 0.24, - ); + disabledBackgroundColor = Color.lerp( + buttonBackgroundColor, + Colors.black, + 0.5, + )!; return ElevatedButton( onPressed: onPressed, @@ -55,12 +57,12 @@ class CustomWidthButton extends StatelessWidget { ); } else if (buttonType == ButtonType.secondary) { textcolor = CustomTheme.primaryColor; - disabledTextColor = CustomTheme.primaryColor.withValues(alpha: 0.5); + disabledTextColor = Color.lerp(textcolor, Colors.black, 0.5)!; buttonBackgroundColor = Colors.transparent; disabledBackgroundColor = Colors.transparent; borderSideColor = onPressed != null ? CustomTheme.primaryColor - : CustomTheme.primaryColor.withValues(alpha: 0.5); + : Color.lerp(CustomTheme.primaryColor, Colors.black, 0.5)!; return OutlinedButton( onPressed: onPressed, @@ -86,7 +88,11 @@ class CustomWidthButton extends StatelessWidget { ); } else { textcolor = CustomTheme.primaryColor; - disabledTextColor = CustomTheme.primaryColor.withValues(alpha: 0.3); + disabledTextColor = Color.lerp( + CustomTheme.primaryColor, + Colors.black, + 0.5, + )!; buttonBackgroundColor = Colors.transparent; disabledBackgroundColor = Colors.transparent;