@@ -11,12 +11,17 @@ class DailyProgressCard extends StatelessWidget {
1111
1212 @override
1313 Widget build (BuildContext context) {
14+ final isDark = Theme .of (context).brightness == Brightness .dark;
15+
1416 return Container (
1517 width: double .infinity,
1618 padding: const EdgeInsets .symmetric (vertical: 30 , horizontal: 20 ),
1719 decoration: BoxDecoration (
18- color: Colors .white ,
20+ color: isDark ? const Color ( 0xFF1A2945 ) : Theme . of (context).colorScheme.surface ,
1921 borderRadius: BorderRadius .circular (30 ),
22+ border: isDark
23+ ? Border .all (color: const Color (0xFF2A3E62 ), width: 1 )
24+ : null ,
2025 ),
2126 child: Column (
2227 children: [
@@ -47,8 +52,21 @@ class DailyProgressCard extends StatelessWidget {
4752 Column (
4853 mainAxisAlignment: MainAxisAlignment .center,
4954 children: [
50- Text ('$completed /$total ' , style: const TextStyle (fontSize: 32 , fontWeight: FontWeight .bold, color: Color (0xFF2C3E50 ))),
51- Text ('Công việc' , style: TextStyle (fontSize: 12 , color: Colors .grey.shade500)),
55+ Text (
56+ '$completed /$total ' ,
57+ style: TextStyle (
58+ fontSize: 32 ,
59+ fontWeight: FontWeight .bold,
60+ color: Theme .of (context).colorScheme.onSurface,
61+ ),
62+ ),
63+ Text (
64+ 'Công việc' ,
65+ style: TextStyle (
66+ fontSize: 12 ,
67+ color: Theme .of (context).colorScheme.onSurfaceVariant,
68+ ),
69+ ),
5270 ],
5371 ),
5472 ],
@@ -58,7 +76,10 @@ class DailyProgressCard extends StatelessWidget {
5876 RichText (
5977 textAlign: TextAlign .center,
6078 text: TextSpan (
61- style: const TextStyle (fontSize: 16 , color: Colors .black87),
79+ style: TextStyle (
80+ fontSize: 16 ,
81+ color: Theme .of (context).colorScheme.onSurface,
82+ ),
6283 children: [
6384 const TextSpan (text: 'Tuyệt vời! Bạn đã hoàn thành ' ),
6485 TextSpan (
@@ -97,18 +118,24 @@ class WeeklyChartCard extends StatelessWidget {
97118
98119 @override
99120 Widget build (BuildContext context) {
121+ final isDark = Theme .of (context).brightness == Brightness .dark;
100122
101123 final bool isPositive = growthPercentage >= 0 ;
102- final Color trendColor = isPositive ? const Color (0xFF2ECC71 ) : Colors .redAccent;
103- final Color trendBgColor = isPositive ? const Color (0xFFE9F7EF ) : const Color (0xFFFFEBEE );
124+ final Color trendColor = isPositive ? const Color (0xFF3DDC84 ) : Colors .redAccent;
125+ final Color trendBgColor = isPositive
126+ ? (isDark ? const Color (0xFF173B3D ) : const Color (0xFFE9F7EF ))
127+ : (isDark ? const Color (0xFF402129 ) : const Color (0xFFFFEBEE ));
104128 final String trendText = "${isPositive ? '+' : '' }$growthPercentage % vs tuần trước" ;
105129
106130 return Container (
107131 width: double .infinity,
108132 padding: const EdgeInsets .all (25 ),
109133 decoration: BoxDecoration (
110- color: Colors .white ,
134+ color: isDark ? const Color ( 0xFF1A2945 ) : Theme . of (context).colorScheme.surface ,
111135 borderRadius: BorderRadius .circular (30 ),
136+ border: isDark
137+ ? Border .all (color: const Color (0xFF2A3E62 ), width: 1 )
138+ : null ,
112139 ),
113140 child: Column (
114141 crossAxisAlignment: CrossAxisAlignment .start,
@@ -129,7 +156,14 @@ class WeeklyChartCard extends StatelessWidget {
129156 ),
130157 ),
131158 const SizedBox (height: 5 ),
132- Text ('$thisWeekTotal Tasks' , style: const TextStyle (fontSize: 22 , fontWeight: FontWeight .bold, color: Color (0xFF2C3E50 ))),
159+ Text (
160+ '$thisWeekTotal Tasks' ,
161+ style: TextStyle (
162+ fontSize: 22 ,
163+ fontWeight: FontWeight .bold,
164+ color: Theme .of (context).colorScheme.onSurface,
165+ ),
166+ ),
133167 ],
134168 ),
135169 Container (
@@ -173,7 +207,9 @@ class WeeklyChartCard extends StatelessWidget {
173207 decoration: BoxDecoration (
174208 color: isActive
175209 ? Theme .of (context).colorScheme.primary
176- : const Color (0xFFF5F7FA ),
210+ : (Theme .of (context).brightness == Brightness .dark
211+ ? const Color (0xFF334764 )
212+ : const Color (0xFFF5F7FA )),
177213 borderRadius: BorderRadius .circular (8 ),
178214 ),
179215 ),
@@ -203,6 +239,7 @@ class CompletedTaskCard extends StatelessWidget {
203239
204240 @override
205241 Widget build (BuildContext context) {
242+ final isDark = Theme .of (context).brightness == Brightness .dark;
206243
207244 final time = task.updatedAt;
208245 final hour = time.hour > 12 ? time.hour - 12 : (time.hour == 0 ? 12 : time.hour);
@@ -239,24 +276,45 @@ class CompletedTaskCard extends StatelessWidget {
239276 margin: const EdgeInsets .only (bottom: 15 ),
240277 padding: const EdgeInsets .all (20 ),
241278 decoration: BoxDecoration (
242- color: Colors .white ,
279+ color: isDark ? const Color ( 0xFF1A2945 ) : Theme . of (context).colorScheme.surface ,
243280 borderRadius: BorderRadius .circular (25 ),
281+ border: isDark
282+ ? Border .all (color: const Color (0xFF2A3E62 ), width: 1 )
283+ : null ,
244284 ),
245285 child: Row (
246286 children: [
247287 Container (
248288 padding: const EdgeInsets .all (12 ),
249- decoration: BoxDecoration (color: const Color (0xFFF1F7FD ), borderRadius: BorderRadius .circular (15 )),
289+ decoration: BoxDecoration (
290+ color: isDark
291+ ? const Color (0xFF23395D )
292+ : const Color (0xFFF1F7FD ),
293+ borderRadius: BorderRadius .circular (15 ),
294+ ),
250295 child: icon,
251296 ),
252297 const SizedBox (width: 15 ),
253298 Expanded (
254299 child: Column (
255300 crossAxisAlignment: CrossAxisAlignment .start,
256301 children: [
257- Text (task.title, style: const TextStyle (fontSize: 16 , fontWeight: FontWeight .bold, color: Color (0xFF2C3E50 ))),
302+ Text (
303+ task.title,
304+ style: TextStyle (
305+ fontSize: 16 ,
306+ fontWeight: FontWeight .bold,
307+ color: Theme .of (context).colorScheme.onSurface,
308+ ),
309+ ),
258310 const SizedBox (height: 4 ),
259- Text (timeString, style: TextStyle (fontSize: 12 , color: Colors .grey.shade500)),
311+ Text (
312+ timeString,
313+ style: TextStyle (
314+ fontSize: 12 ,
315+ color: Theme .of (context).colorScheme.onSurfaceVariant,
316+ ),
317+ ),
260318 ],
261319 ),
262320 ),
0 commit comments