diff --git a/forui/lib/src/widgets/button/button.dart b/forui/lib/src/widgets/button/button.dart index 4f69baa86..0cb291a8d 100644 --- a/forui/lib/src/widgets/button/button.dart +++ b/forui/lib/src/widgets/button/button.dart @@ -65,7 +65,7 @@ class FButton extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( border: Border.all( - color: onPressed == null ? style.disabled : style.border, + color: onPressed == null ? style.disabledBorder : style.border, ), borderRadius: style.borderRadius, color: onPressed == null ? style.disabled : style.background, diff --git a/forui/lib/src/widgets/button/button_content.dart b/forui/lib/src/widgets/button/button_content.dart index ac22f8c0d..35e2e39a1 100644 --- a/forui/lib/src/widgets/button/button_content.dart +++ b/forui/lib/src/widgets/button/button_content.dart @@ -44,7 +44,7 @@ final class FButtonContent extends StatelessWidget { child: Text( text!, style: style.content.text.copyWith( - color: disabled ? style.disabled : style.foreground, + color: disabled ? style.content.text.color!.withOpacity(0.5) : style.content.text.color, ), ), ), diff --git a/forui/lib/src/widgets/button/button_style.dart b/forui/lib/src/widgets/button/button_style.dart index e4faded8b..64dd0e866 100644 --- a/forui/lib/src/widgets/button/button_style.dart +++ b/forui/lib/src/widgets/button/button_style.dart @@ -8,12 +8,15 @@ class FButtonStyle extends FButtonDesign { /// The foreground color. final Color foreground; - /// The primary color. + /// The disabled color. final Color disabled; /// The border color. final Color border; + /// The disabled border color. + final Color disabledBorder; + /// The border radius. final BorderRadius borderRadius; @@ -26,6 +29,7 @@ class FButtonStyle extends FButtonDesign { required this.foreground, required this.disabled, required this.border, + required this.disabledBorder, required this.borderRadius, required this.content, }); @@ -36,6 +40,7 @@ class FButtonStyle extends FButtonDesign { Color? foreground, Color? disabled, Color? border, + Color? disabledBorder, BorderRadius? borderRadius, FButtonContentStyle? content, }) => @@ -44,6 +49,7 @@ class FButtonStyle extends FButtonDesign { foreground: foreground ?? this.foreground, disabled: disabled ?? this.disabled, border: border ?? this.border, + disabledBorder: disabledBorder ?? this.disabledBorder, borderRadius: borderRadius ?? this.borderRadius, content: content ?? this.content, ); diff --git a/forui/lib/src/widgets/button/button_styles.dart b/forui/lib/src/widgets/button/button_styles.dart index 3284866c1..09753093d 100644 --- a/forui/lib/src/widgets/button/button_styles.dart +++ b/forui/lib/src/widgets/button/button_styles.dart @@ -27,8 +27,9 @@ class FButtonStyles { : primary = FButtonStyle( background: style.primary, foreground: style.primaryForeground, - disabled: style.mutedForeground, + disabled: const Color(0xFF787878), border: style.primary, + disabledBorder: const Color(0xFF787878), borderRadius: style.borderRadius, content: FButtonContentStyle.inherit( font: font, @@ -36,10 +37,11 @@ class FButtonStyles { ), ), secondary = FButtonStyle( - background: style.mutedForeground, + background: style.secondary, foreground: style.secondaryForeground, - disabled: style.mutedForeground, - border: style.mutedForeground, + disabled: const Color(0xFFF7F7F8), + border: style.secondary, + disabledBorder: const Color(0xFFF7F7F8), borderRadius: style.borderRadius, content: FButtonContentStyle.inherit( font: font, @@ -48,20 +50,22 @@ class FButtonStyles { ), destructive = FButtonStyle( background: style.destructive, - foreground: style.foreground, - disabled: style.mutedForeground, + foreground: style.destructiveForeground, + disabled: const Color(0xFFEFAAAA), border: style.destructive, + disabledBorder: const Color(0xFFEFAAAA), borderRadius: style.borderRadius, content: FButtonContentStyle.inherit( font: font, - color: style.foreground, + color: style.destructiveForeground, ), ), outlined = FButtonStyle( - background: style.secondary, + background: style.background, foreground: style.secondaryForeground, - disabled: style.mutedForeground, - border: style.mutedForeground, + disabled: style.background, + border: style.border, + disabledBorder: const Color(0xFFF0F0F0), borderRadius: style.borderRadius, content: FButtonContentStyle.inherit( font: font, diff --git a/samples/lib/main.dart b/samples/lib/main.dart index 3cb46e06d..2c0d9f6bf 100644 --- a/samples/lib/main.dart +++ b/samples/lib/main.dart @@ -31,10 +31,10 @@ class Application extends StatelessWidget { ), ), ), - const SizedBox(height: 20,), + const SizedBox(height: 20), FButton( - style: FButtonVariant.primary, - onPressed: () {}, + style: FButtonVariant.outlined, + onPressed: null, //icon: 'icon', text: 'Hi', )