@@ -17,24 +17,21 @@ class AppThemes {
17
17
shadowColor: MaterialStateProperty .all (Colors .black.withOpacity (0.2 )),
18
18
),
19
19
),
20
- // Add button themes for light mode
21
20
elevatedButtonTheme: ElevatedButtonThemeData (
22
21
style: ButtonStyle (
23
- backgroundColor:
24
- MaterialStateProperty .all (Colors .blue), // Background color
25
- foregroundColor: MaterialStateProperty .all (Colors .white), // Text color
22
+ backgroundColor: MaterialStateProperty .all (Colors .blue),
23
+ foregroundColor: MaterialStateProperty .all (Colors .white),
26
24
),
27
25
),
28
26
textButtonTheme: TextButtonThemeData (
29
27
style: ButtonStyle (
30
- foregroundColor: MaterialStateProperty .all (Colors .blue), // Text color
28
+ foregroundColor: MaterialStateProperty .all (Colors .blue),
31
29
),
32
30
),
33
31
outlinedButtonTheme: OutlinedButtonThemeData (
34
32
style: ButtonStyle (
35
- foregroundColor: MaterialStateProperty .all (Colors .blue), // Text color
36
- side: MaterialStateProperty .all (
37
- BorderSide (color: Colors .blue)), // Border color
33
+ foregroundColor: MaterialStateProperty .all (Colors .blue),
34
+ side: MaterialStateProperty .all (BorderSide (color: Colors .blue)),
38
35
),
39
36
),
40
37
);
@@ -52,24 +49,21 @@ class AppThemes {
52
49
shadowColor: MaterialStateProperty .all (Colors .black.withOpacity (0.5 )),
53
50
),
54
51
),
55
- // Add button themes for dark mode
56
52
elevatedButtonTheme: ElevatedButtonThemeData (
57
53
style: ButtonStyle (
58
- backgroundColor:
59
- MaterialStateProperty .all (Colors .purple), // Background color
60
- foregroundColor: MaterialStateProperty .all (Colors .white), // Text color
54
+ backgroundColor: MaterialStateProperty .all (Colors .purple),
55
+ foregroundColor: MaterialStateProperty .all (Colors .white),
61
56
),
62
57
),
63
58
textButtonTheme: TextButtonThemeData (
64
59
style: ButtonStyle (
65
- foregroundColor: MaterialStateProperty .all (Colors .purple), // Text color
60
+ foregroundColor: MaterialStateProperty .all (Colors .purple),
66
61
),
67
62
),
68
63
outlinedButtonTheme: OutlinedButtonThemeData (
69
64
style: ButtonStyle (
70
- foregroundColor: MaterialStateProperty .all (Colors .purple), // Text color
71
- side: MaterialStateProperty .all (
72
- BorderSide (color: Colors .purple)), // Border color
65
+ foregroundColor: MaterialStateProperty .all (Colors .purple),
66
+ side: MaterialStateProperty .all (BorderSide (color: Colors .purple)),
73
67
),
74
68
),
75
69
);
@@ -90,24 +84,126 @@ class AppThemes {
90
84
shadowColor: MaterialStateProperty .all (Colors .pink.withOpacity (0.5 )),
91
85
),
92
86
),
93
- // Add button themes for pink mode
94
87
elevatedButtonTheme: ElevatedButtonThemeData (
95
88
style: ButtonStyle (
96
- backgroundColor:
97
- MaterialStateProperty .all (Colors .pink), // Background color
98
- foregroundColor: MaterialStateProperty .all (Colors .white), // Text color
89
+ backgroundColor: MaterialStateProperty .all (Colors .pink),
90
+ foregroundColor: MaterialStateProperty .all (Colors .white),
99
91
),
100
92
),
101
93
textButtonTheme: TextButtonThemeData (
102
94
style: ButtonStyle (
103
- foregroundColor: MaterialStateProperty .all (Colors .pink), // Text color
95
+ foregroundColor: MaterialStateProperty .all (Colors .pink),
104
96
),
105
97
),
106
98
outlinedButtonTheme: OutlinedButtonThemeData (
107
99
style: ButtonStyle (
108
- foregroundColor: MaterialStateProperty .all (Colors .pink), // Text color
109
- side: MaterialStateProperty .all (
110
- BorderSide (color: Colors .pink)), // Border color
100
+ foregroundColor: MaterialStateProperty .all (Colors .pink),
101
+ side: MaterialStateProperty .all (BorderSide (color: Colors .pink)),
102
+ ),
103
+ ),
104
+ );
105
+
106
+ static ThemeData greenTheme = ThemeData (
107
+ brightness: Brightness .light,
108
+ primarySwatch: Colors .green,
109
+ iconTheme: IconThemeData (color: Colors .green),
110
+ colorScheme: ColorScheme .fromSeed (
111
+ seedColor: Colors .green,
112
+ primary: Colors .green,
113
+ secondary: Colors .greenAccent,
114
+ ),
115
+ dropdownMenuTheme: DropdownMenuThemeData (
116
+ menuStyle: MenuStyle (
117
+ backgroundColor: MaterialStateProperty .all (Colors .green.shade50),
118
+ elevation: MaterialStateProperty .all (8.0 ),
119
+ shadowColor: MaterialStateProperty .all (Colors .green.withOpacity (0.5 )),
120
+ ),
121
+ ),
122
+ elevatedButtonTheme: ElevatedButtonThemeData (
123
+ style: ButtonStyle (
124
+ backgroundColor: MaterialStateProperty .all (Colors .green),
125
+ foregroundColor: MaterialStateProperty .all (Colors .white),
126
+ ),
127
+ ),
128
+ textButtonTheme: TextButtonThemeData (
129
+ style: ButtonStyle (
130
+ foregroundColor: MaterialStateProperty .all (Colors .green),
131
+ ),
132
+ ),
133
+ outlinedButtonTheme: OutlinedButtonThemeData (
134
+ style: ButtonStyle (
135
+ foregroundColor: MaterialStateProperty .all (Colors .green),
136
+ side: MaterialStateProperty .all (BorderSide (color: Colors .green)),
137
+ ),
138
+ ),
139
+ );
140
+
141
+ static ThemeData orangeTheme = ThemeData (
142
+ brightness: Brightness .light,
143
+ primarySwatch: Colors .orange,
144
+ iconTheme: IconThemeData (color: Colors .orange),
145
+ colorScheme: ColorScheme .fromSeed (
146
+ seedColor: Colors .orange,
147
+ primary: Colors .orange,
148
+ secondary: Colors .orangeAccent,
149
+ ),
150
+ dropdownMenuTheme: DropdownMenuThemeData (
151
+ menuStyle: MenuStyle (
152
+ backgroundColor: MaterialStateProperty .all (Colors .orange.shade50),
153
+ elevation: MaterialStateProperty .all (8.0 ),
154
+ shadowColor: MaterialStateProperty .all (Colors .orange.withOpacity (0.5 )),
155
+ ),
156
+ ),
157
+ elevatedButtonTheme: ElevatedButtonThemeData (
158
+ style: ButtonStyle (
159
+ backgroundColor: MaterialStateProperty .all (Colors .orange),
160
+ foregroundColor: MaterialStateProperty .all (Colors .white),
161
+ ),
162
+ ),
163
+ textButtonTheme: TextButtonThemeData (
164
+ style: ButtonStyle (
165
+ foregroundColor: MaterialStateProperty .all (Colors .orange),
166
+ ),
167
+ ),
168
+ outlinedButtonTheme: OutlinedButtonThemeData (
169
+ style: ButtonStyle (
170
+ foregroundColor: MaterialStateProperty .all (Colors .orange),
171
+ side: MaterialStateProperty .all (BorderSide (color: Colors .orange)),
172
+ ),
173
+ ),
174
+ );
175
+
176
+ static ThemeData redTheme = ThemeData (
177
+ brightness: Brightness .light,
178
+ primarySwatch: Colors .red,
179
+ iconTheme: IconThemeData (color: Colors .red),
180
+ colorScheme: ColorScheme .fromSeed (
181
+ seedColor: Colors .red,
182
+ primary: Colors .red,
183
+ secondary: Colors .redAccent,
184
+ ),
185
+ dropdownMenuTheme: DropdownMenuThemeData (
186
+ menuStyle: MenuStyle (
187
+ backgroundColor: MaterialStateProperty .all (Colors .red.shade50),
188
+ elevation: MaterialStateProperty .all (8.0 ),
189
+ shadowColor: MaterialStateProperty .all (Colors .red.withOpacity (0.5 )),
190
+ ),
191
+ ),
192
+ elevatedButtonTheme: ElevatedButtonThemeData (
193
+ style: ButtonStyle (
194
+ backgroundColor: MaterialStateProperty .all (Colors .red),
195
+ foregroundColor: MaterialStateProperty .all (Colors .white),
196
+ ),
197
+ ),
198
+ textButtonTheme: TextButtonThemeData (
199
+ style: ButtonStyle (
200
+ foregroundColor: MaterialStateProperty .all (Colors .red),
201
+ ),
202
+ ),
203
+ outlinedButtonTheme: OutlinedButtonThemeData (
204
+ style: ButtonStyle (
205
+ foregroundColor: MaterialStateProperty .all (Colors .red),
206
+ side: MaterialStateProperty .all (BorderSide (color: Colors .red)),
111
207
),
112
208
),
113
209
);
@@ -120,25 +216,36 @@ class AppThemes {
120
216
return darkTheme;
121
217
case AppTheme .pink:
122
218
return pinkTheme;
219
+ case AppTheme .green:
220
+ return greenTheme;
221
+ case AppTheme .orange:
222
+ return orangeTheme;
223
+ case AppTheme .red:
224
+ return redTheme;
123
225
case AppTheme .system:
124
226
default :
125
227
return brightness == Brightness .dark ? darkTheme : lightTheme;
126
228
}
127
229
}
128
230
}
129
231
130
- enum AppTheme { system, light, dark, pink }
232
+ enum AppTheme { system, light, dark, pink, green, orange, red }
131
233
132
234
// Extension on ThemeData to include the primaryChartColor
133
235
extension ChartColors on ThemeData {
134
236
Color get primaryChartColor {
135
- // Use primary color or fallback to specific colors based on brightness
136
237
if (brightness == Brightness .dark) {
137
- return colorScheme.primary; // Typically purple in dark mode
238
+ return colorScheme.primary;
138
239
} else if (colorScheme.primary == Colors .pink) {
139
- return Colors .pink; // Pink theme case
240
+ return Colors .pink;
241
+ } else if (colorScheme.primary == Colors .green) {
242
+ return Colors .green;
243
+ } else if (colorScheme.primary == Colors .orange) {
244
+ return Colors .orange;
245
+ } else if (colorScheme.primary == Colors .red) {
246
+ return Colors .red;
140
247
} else {
141
- return Colors .blue; // Default to blue in light mode
248
+ return Colors .blue;
142
249
}
143
250
}
144
251
}
0 commit comments