Skip to content

Commit 7e82a08

Browse files
authored
fix: secondary button outline color (#4381)
* chore: restore the default outline color in SecondaryButton * chore: improve outline color for learn more button
1 parent f0bd50b commit 7e82a08

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/theme_upload/theme_upload_learn_more_button.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class ThemeUploadLearnMoreButton extends StatelessWidget {
2020
height: ThemeUploadWidget.buttonSize.height,
2121
child: IntrinsicWidth(
2222
child: SecondaryButton(
23+
outlineColor: Theme.of(context).colorScheme.onBackground,
2324
child: Padding(
2425
padding: const EdgeInsets.symmetric(horizontal: 8),
2526
child: FlowyText.medium(

frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/buttons/secondary_button.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,26 @@ class SecondaryTextButton extends StatelessWidget {
3737
this.label, {
3838
super.key,
3939
this.onPressed,
40+
this.textColor,
41+
this.outlineColor,
4042
this.mode = TextButtonMode.normal,
4143
});
4244

4345
final String label;
4446
final VoidCallback? onPressed;
4547
final TextButtonMode mode;
48+
final Color? textColor;
49+
final Color? outlineColor;
4650

4751
@override
4852
Widget build(BuildContext context) {
4953
return SecondaryButton(
5054
mode: mode,
5155
onPressed: onPressed,
56+
outlineColor: outlineColor,
5257
child: FlowyText.regular(
5358
label,
54-
color: Theme.of(context).colorScheme.primary,
59+
color: textColor ?? Theme.of(context).colorScheme.primary,
5560
),
5661
);
5762
}
@@ -62,12 +67,14 @@ class SecondaryButton extends StatelessWidget {
6267
super.key,
6368
required this.child,
6469
this.onPressed,
70+
this.outlineColor,
6571
this.mode = TextButtonMode.normal,
6672
});
6773

6874
final Widget child;
6975
final VoidCallback? onPressed;
7076
final TextButtonMode mode;
77+
final Color? outlineColor;
7178

7279
@override
7380
Widget build(BuildContext context) {
@@ -77,7 +84,7 @@ class SecondaryButton extends StatelessWidget {
7784
minHeight: size.height,
7885
contentPadding: EdgeInsets.zero,
7986
bgColor: Colors.transparent,
80-
outlineColor: Theme.of(context).colorScheme.onBackground,
87+
outlineColor: outlineColor ?? Theme.of(context).colorScheme.primary,
8188
borderRadius: mode.borderRadius,
8289
onPressed: onPressed,
8390
child: child,

0 commit comments

Comments
 (0)