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, height: ThemeUploadWidget.buttonSize.height,
child: IntrinsicWidth( child: IntrinsicWidth(
child: SecondaryButton( child: SecondaryButton(
outlineColor: Theme.of(context).colorScheme.onBackground,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8), padding: const EdgeInsets.symmetric(horizontal: 8),
child: FlowyText.medium( child: FlowyText.medium(

View File

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