fix: secondary button outline color (#4381)

* chore: restore the default outline color in SecondaryButton

* chore: improve outline color for learn more button
This commit is contained in:
Yijing Huang 2024-01-14 08:54:59 -06:00 committed by GitHub
parent f0bd50b246
commit 7e82a08b54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -20,6 +20,7 @@ class ThemeUploadLearnMoreButton extends StatelessWidget {
height: ThemeUploadWidget.buttonSize.height,
child: IntrinsicWidth(
child: SecondaryButton(
outlineColor: Theme.of(context).colorScheme.onBackground,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: FlowyText.medium(

View File

@ -37,21 +37,26 @@ class SecondaryTextButton extends StatelessWidget {
this.label, {
super.key,
this.onPressed,
this.textColor,
this.outlineColor,
this.mode = TextButtonMode.normal,
});
final String label;
final VoidCallback? onPressed;
final TextButtonMode mode;
final Color? textColor;
final Color? outlineColor;
@override
Widget build(BuildContext context) {
return SecondaryButton(
mode: mode,
onPressed: onPressed,
outlineColor: outlineColor,
child: FlowyText.regular(
label,
color: Theme.of(context).colorScheme.primary,
color: textColor ?? Theme.of(context).colorScheme.primary,
),
);
}
@ -62,12 +67,14 @@ class SecondaryButton extends StatelessWidget {
super.key,
required this.child,
this.onPressed,
this.outlineColor,
this.mode = TextButtonMode.normal,
});
final Widget child;
final VoidCallback? onPressed;
final TextButtonMode mode;
final Color? outlineColor;
@override
Widget build(BuildContext context) {
@ -77,7 +84,7 @@ class SecondaryButton extends StatelessWidget {
minHeight: size.height,
contentPadding: EdgeInsets.zero,
bgColor: Colors.transparent,
outlineColor: Theme.of(context).colorScheme.onBackground,
outlineColor: outlineColor ?? Theme.of(context).colorScheme.primary,
borderRadius: mode.borderRadius,
onPressed: onPressed,
child: child,