@@ -50,7 +50,10 @@ class _TaskDetailScreenState extends State<TaskDetailScreen> {
5050
5151 // Show success message
5252 ScaffoldMessenger .of (context).showSnackBar (
53- const SnackBar (content: Text ('Task updated successfully!' ), backgroundColor: Colors .green),
53+ SnackBar (
54+ content: const Text ('Task updated successfully!' ),
55+ backgroundColor: Theme .of (context).colorScheme.tertiary,
56+ ),
5457 );
5558
5659 // Return to the previous screen
@@ -61,6 +64,7 @@ class _TaskDetailScreenState extends State<TaskDetailScreen> {
6164 Widget build (BuildContext context) {
6265 // Format date for display
6366 String formattedDate = DateFormat ('EEEE, d MMMM' ).format (widget.task.date);
67+ final isDark = Theme .of (context).brightness == Brightness .dark;
6468
6569 // Mock categories (Fetch from database later)
6670 List <String > categories = ['Development' , 'Research' , 'Design' , 'Backend' ];
@@ -71,10 +75,19 @@ class _TaskDetailScreenState extends State<TaskDetailScreen> {
7175 backgroundColor: Colors .transparent,
7276 elevation: 0 ,
7377 leading: IconButton (
74- icon: const Icon (Icons .arrow_back_ios_new_rounded, color: Colors .black),
78+ icon: Icon (
79+ Icons .arrow_back_ios_new_rounded,
80+ color: Theme .of (context).colorScheme.onSurface,
81+ ),
7582 onPressed: () => Navigator .pop (context),
7683 ),
77- title: const Text ('Task Details' , style: TextStyle (color: Colors .black, fontWeight: FontWeight .bold)),
84+ title: Text (
85+ 'Task Details' ,
86+ style: TextStyle (
87+ color: Theme .of (context).colorScheme.onSurface,
88+ fontWeight: FontWeight .bold,
89+ ),
90+ ),
7891 centerTitle: true ,
7992 ),
8093 body: SafeArea (
@@ -85,8 +98,11 @@ class _TaskDetailScreenState extends State<TaskDetailScreen> {
8598 child: Container (
8699 margin: const EdgeInsets .all (20 ),
87100 decoration: BoxDecoration (
88- color: Colors .white ,
101+ color: Theme . of (context).colorScheme.surface ,
89102 borderRadius: BorderRadius .circular (30 ),
103+ border: isDark
104+ ? Border .all (color: Theme .of (context).colorScheme.outline)
105+ : null ,
90106 boxShadow: [
91107 BoxShadow (color: Colors .black.withValues (alpha: 0.05 ), blurRadius: 10 , offset: const Offset (0 , 5 ))
92108 ],
@@ -119,7 +135,9 @@ class _TaskDetailScreenState extends State<TaskDetailScreen> {
119135 onSelected: (selected) {
120136 if (selected) setState (() => _currentCategory = categories[index]);
121137 },
122- backgroundColor: const Color (0xFFF1F7FD ),
138+ backgroundColor: isDark
139+ ? Theme .of (context).colorScheme.surfaceContainerHighest
140+ : const Color (0xFFF1F7FD ),
123141 selectedColor: Theme .of (context).colorScheme.primary,
124142 labelStyle: TextStyle (
125143 color: isSelected
@@ -129,7 +147,12 @@ class _TaskDetailScreenState extends State<TaskDetailScreen> {
129147 ),
130148 shape: RoundedRectangleBorder (
131149 borderRadius: BorderRadius .circular (10 ),
132- side: const BorderSide (color: Color (0xFFF1F7FD ), width: 1 )),
150+ side: BorderSide (
151+ color: isDark
152+ ? Theme .of (context).colorScheme.outline
153+ : const Color (0xFFF1F7FD ),
154+ width: 1 ,
155+ )),
133156 showCheckmark: false ,
134157 ),
135158 );
@@ -141,7 +164,14 @@ class _TaskDetailScreenState extends State<TaskDetailScreen> {
141164 // Display Task Date
142165 Text ('Date' , style: Theme .of (context).textTheme.labelLarge),
143166 const SizedBox (height: 5 ),
144- Text (formattedDate, style: const TextStyle (fontSize: 18 , fontWeight: FontWeight .bold, color: Colors .black)),
167+ Text (
168+ formattedDate,
169+ style: TextStyle (
170+ fontSize: 18 ,
171+ fontWeight: FontWeight .bold,
172+ color: Theme .of (context).colorScheme.onSurface,
173+ ),
174+ ),
145175 const SizedBox (height: 25 ),
146176
147177 // Time Pickers for Start and End time
0 commit comments