From 7e82a08b54363ffb4cb7b213946cd85857a1c6a8 Mon Sep 17 00:00:00 2001 From: Yijing Huang Date: Sun, 14 Jan 2024 08:54:59 -0600 Subject: [PATCH] fix: secondary button outline color (#4381) * chore: restore the default outline color in SecondaryButton * chore: improve outline color for learn more button --- .../theme_upload/theme_upload_learn_more_button.dart | 1 + .../lib/widget/buttons/secondary_button.dart | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/theme_upload/theme_upload_learn_more_button.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/theme_upload/theme_upload_learn_more_button.dart index 5c2d8a9fb5..e685c582ba 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/theme_upload/theme_upload_learn_more_button.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/theme_upload/theme_upload_learn_more_button.dart @@ -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( diff --git a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/buttons/secondary_button.dart b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/buttons/secondary_button.dart index e1014a226b..def795ed44 100644 --- a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/buttons/secondary_button.dart +++ b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/buttons/secondary_button.dart @@ -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,