Merge pull request 'Button ist transparent' (#41) from bug/40-button-ist-transparent into development

Reviewed-on: #41
Reviewed-by: mathiskir <mathis.kirchner.mk@gmail.com>
This commit was merged in pull request #41.
This commit is contained in:
2025-11-19 18:35:41 +00:00

View File

@@ -26,11 +26,13 @@ class CustomWidthButton extends StatelessWidget {
if (buttonType == ButtonType.primary) { if (buttonType == ButtonType.primary) {
textcolor = Colors.white; textcolor = Colors.white;
disabledTextColor = Colors.white.withValues(alpha: 0.24); disabledTextColor = Color.lerp(textcolor, Colors.black, 0.5)!;
buttonBackgroundColor = CustomTheme.primaryColor; buttonBackgroundColor = CustomTheme.primaryColor;
disabledBackgroundColor = CustomTheme.primaryColor.withValues( disabledBackgroundColor = Color.lerp(
alpha: 0.24, buttonBackgroundColor,
); Colors.black,
0.5,
)!;
return ElevatedButton( return ElevatedButton(
onPressed: onPressed, onPressed: onPressed,
@@ -55,12 +57,12 @@ class CustomWidthButton extends StatelessWidget {
); );
} else if (buttonType == ButtonType.secondary) { } else if (buttonType == ButtonType.secondary) {
textcolor = CustomTheme.primaryColor; textcolor = CustomTheme.primaryColor;
disabledTextColor = CustomTheme.primaryColor.withValues(alpha: 0.5); disabledTextColor = Color.lerp(textcolor, Colors.black, 0.5)!;
buttonBackgroundColor = Colors.transparent; buttonBackgroundColor = Colors.transparent;
disabledBackgroundColor = Colors.transparent; disabledBackgroundColor = Colors.transparent;
borderSideColor = onPressed != null borderSideColor = onPressed != null
? CustomTheme.primaryColor ? CustomTheme.primaryColor
: CustomTheme.primaryColor.withValues(alpha: 0.5); : Color.lerp(CustomTheme.primaryColor, Colors.black, 0.5)!;
return OutlinedButton( return OutlinedButton(
onPressed: onPressed, onPressed: onPressed,
@@ -86,7 +88,11 @@ class CustomWidthButton extends StatelessWidget {
); );
} else { } else {
textcolor = CustomTheme.primaryColor; textcolor = CustomTheme.primaryColor;
disabledTextColor = CustomTheme.primaryColor.withValues(alpha: 0.3); disabledTextColor = Color.lerp(
CustomTheme.primaryColor,
Colors.black,
0.5,
)!;
buttonBackgroundColor = Colors.transparent; buttonBackgroundColor = Colors.transparent;
disabledBackgroundColor = Colors.transparent; disabledBackgroundColor = Colors.transparent;