Skip to content

Commit 31bd0d3

Browse files
author
Lukas Gundermann
committed
Merge remote-tracking branch 'origin/main'
# Conflicts: # lib/screens/widgets/overrides/button_themes.dart
2 parents 10dbbf5 + 68bf9c8 commit 31bd0d3

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

lib/screens/widgets/overrides/button_themes.dart

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ class ButtonThemes extends StatelessWidget {
1111
@override
1212
Widget build(BuildContext context) {
1313
final isDark = context.watch<ThemeCubit>().state.isDarkMode;
14-
final bgColor = isDark ? Colors.gray[400] : Colors.gray[100];
15-
final textColor = isDark ? Colors.black : Colors.blue[900];
16-
final iconColor = textColor;
1714
return ComponentTheme(
1815
data: OutlineButtonTheme(
1916
decoration: (context, states, defaultDecoration) {
@@ -33,18 +30,18 @@ class ButtonThemes extends StatelessWidget {
3330
);
3431
} else {
3532
return defaultDecoration.copyWithIfBoxDecoration(
36-
color: bgColor,
33+
color: isDark ? Colors.gray[400] : Colors.gray[100],
3734
border: Border.all(
3835
color: isDark ? Colors.blue[100] : Colors.blue[900],
3936
),
4037
);
4138
}
4239
},
4340
textStyle: (context, states, defaultTextStyle) {
44-
return defaultTextStyle.copyWith(color: textColor);
41+
return defaultTextStyle.copyWith(color: isDark ? Colors.black : Colors.blue[900]);
4542
},
4643
iconTheme: (context, states, defaultIconTheme) {
47-
return defaultIconTheme.copyWith(color: iconColor);
44+
return defaultIconTheme.copyWith(color: isDark ? Colors.black : Colors.blue[900]);
4845
},
4946
),
5047
child: ComponentTheme(
@@ -59,14 +56,14 @@ class ButtonThemes extends StatelessWidget {
5956
color: isDark ? Colors.gray[300] : Colors.gray[200],
6057
);
6158
} else {
62-
return defaultDecoration.copyWithIfBoxDecoration(color: bgColor);
59+
return defaultDecoration.copyWithIfBoxDecoration(color: isDark ? Colors.gray[400] : Colors.gray[100]);
6360
}
6461
},
6562
textStyle: (context, states, defaultTextStyle) {
66-
return defaultTextStyle.copyWith(color: textColor);
63+
return defaultTextStyle.copyWith(color: isDark ? Colors.black : Colors.blue[900]);
6764
},
6865
iconTheme: (context, states, defaultIconTheme) {
69-
return defaultIconTheme.copyWith(color: iconColor);
66+
return defaultIconTheme.copyWith(color: isDark ? Colors.black : Colors.blue[900]);
7067
},
7168
),
7269
child: ComponentTheme(
@@ -84,20 +81,22 @@ class ButtonThemes extends StatelessWidget {
8481
return defaultTextStyle.copyWith(
8582
color: isDark ? Colors.gray[300] : Colors.gray[600],
8683
);
87-
} else if (states.contains(WidgetState.hovered)) {
88-
return defaultTextStyle.copyWith(
89-
color: isDark ? Colors.gray[300] : Colors.blue[900],
90-
);
9184
} else {
9285
return defaultTextStyle.copyWith(
9386
color: isDark ? Colors.gray[300] : Colors.blue[900],
9487
);
9588
}
9689
},
9790
iconTheme: (context, states, defaultIconTheme) {
98-
return defaultIconTheme.copyWith(
99-
color: isDark ? Colors.gray[300] : Colors.blue[900],
100-
);
91+
if (states.contains(WidgetState.disabled)) {
92+
return defaultIconTheme.copyWith(
93+
color: isDark ? Colors.gray[300] : Colors.gray[600],
94+
);
95+
} else {
96+
return defaultIconTheme.copyWith(
97+
color: isDark ? Colors.gray[300] : Colors.blue[900],
98+
);
99+
}
101100
},
102101
),
103102
child: ComponentTheme(

0 commit comments

Comments
 (0)