Skip to content

Commit

Permalink
colors tested
Browse files Browse the repository at this point in the history
  • Loading branch information
Daviiddoo committed May 29, 2024
1 parent 81e075e commit 4e5a414
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion forui/lib/src/widgets/button/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion forui/lib/src/widgets/button/button_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
),
),
Expand Down
8 changes: 7 additions & 1 deletion forui/lib/src/widgets/button/button_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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,
});
Expand All @@ -36,6 +40,7 @@ class FButtonStyle extends FButtonDesign {
Color? foreground,
Color? disabled,
Color? border,
Color? disabledBorder,
BorderRadius? borderRadius,
FButtonContentStyle? content,
}) =>
Expand All @@ -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,
);
Expand Down
24 changes: 14 additions & 10 deletions forui/lib/src/widgets/button/button_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,21 @@ 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,
color: style.primaryForeground,
),
),
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,
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions samples/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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',
)
Expand Down

0 comments on commit 4e5a414

Please sign in to comment.