From 52f962ae2efd41c30c1dcc1bc6c4f168e27119d0 Mon Sep 17 00:00:00 2001 From: otsmr Date: Sun, 7 Jun 2026 12:53:44 +0200 Subject: [PATCH] fix transparent color --- lib/src/visual/elements/my_button.element.dart | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/src/visual/elements/my_button.element.dart b/lib/src/visual/elements/my_button.element.dart index 3bbec5cc..4f5e1c15 100644 --- a/lib/src/visual/elements/my_button.element.dart +++ b/lib/src/visual/elements/my_button.element.dart @@ -98,6 +98,12 @@ class _MyButtonState extends State final scale = 1.0 - (_controller.value * 0.02); final isEnabled = widget.onPressed != null || widget.onLongPress != null; final isDark = isDarkMode(context); + final disabledBgColor = isDark + ? const Color(0xFF353535) + : const Color(0xFFE0E0E0); + final disabledFgColor = isDark + ? const Color(0xFF757575) + : const Color(0xFF9E9E9E); late final ButtonStyle buttonStyle; switch (widget.variant) { @@ -105,6 +111,8 @@ class _MyButtonState extends State buttonStyle = FilledButton.styleFrom( backgroundColor: primaryColor, foregroundColor: Colors.black87, + disabledBackgroundColor: disabledBgColor, + disabledForegroundColor: disabledFgColor, minimumSize: const Size.fromHeight(60), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(18), @@ -119,6 +127,8 @@ class _MyButtonState extends State buttonStyle = FilledButton.styleFrom( backgroundColor: isDark ? Colors.grey[800] : Colors.grey[200], foregroundColor: isDark ? Colors.white : Colors.black87, + disabledBackgroundColor: disabledBgColor, + disabledForegroundColor: disabledFgColor, minimumSize: const Size.fromHeight(60), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(18), @@ -135,6 +145,7 @@ class _MyButtonState extends State foregroundColor: isDark ? Colors.white.withValues(alpha: 0.7) : Colors.black.withValues(alpha: 0.7), + disabledForegroundColor: disabledFgColor, textStyle: const TextStyle( fontSize: 15, fontWeight: FontWeight.w600, @@ -147,6 +158,8 @@ class _MyButtonState extends State buttonStyle = FilledButton.styleFrom( backgroundColor: primaryColor, foregroundColor: Colors.black87, + disabledBackgroundColor: disabledBgColor, + disabledForegroundColor: disabledFgColor, minimumSize: const Size(0, 48), padding: const EdgeInsets.symmetric( horizontal: 24, @@ -164,6 +177,8 @@ class _MyButtonState extends State buttonStyle = FilledButton.styleFrom( backgroundColor: primaryColor, foregroundColor: Colors.black87, + disabledBackgroundColor: disabledBgColor, + disabledForegroundColor: disabledFgColor, minimumSize: const Size(0, 40), padding: const EdgeInsets.symmetric( horizontal: 16, @@ -181,6 +196,8 @@ class _MyButtonState extends State buttonStyle = FilledButton.styleFrom( backgroundColor: isDark ? Colors.grey[800] : Colors.grey[200], foregroundColor: isDark ? Colors.white : Colors.black87, + disabledBackgroundColor: disabledBgColor, + disabledForegroundColor: disabledFgColor, minimumSize: const Size(0, 40), padding: const EdgeInsets.symmetric( horizontal: 16,