@@ -42,61 +42,94 @@ class ProjectsColumn extends StatelessWidget {
42
42
@override
43
43
Widget build (BuildContext context) {
44
44
return InheritedProjects (
45
- projectFilter: projectFilter,
46
- callback: callback,
47
- projects: projects,
48
- child: ExpansionTile (
49
- key: const PageStorageKey ('project-filter' ),
50
- title: RichText (
51
- maxLines: 2 ,
52
- text: TextSpan (
53
- children: < TextSpan > [
54
- TextSpan (
55
- text: 'Project : ' ,
56
- style: GoogleFonts .firaMono (
57
- fontWeight: FontWeight .bold,
58
- fontSize: 15 ,
59
- color: AppSettings .isDarkMode ? Colors .white : Colors .black,
60
- ),
45
+ projectFilter: projectFilter,
46
+ callback: callback,
47
+ projects: projects,
48
+ child: Column (
49
+ children: [
50
+ Padding (
51
+ padding: const EdgeInsets .all (10.0 ),
52
+ child: Row (
53
+ mainAxisAlignment: MainAxisAlignment .center,
54
+ crossAxisAlignment: CrossAxisAlignment .center,
55
+ children: [
56
+ Text (
57
+ "Project : " ,
58
+ style: GoogleFonts .firaMono (
59
+ fontWeight: FontWeight .bold,
60
+ fontSize: 15 ,
61
+ color:
62
+ AppSettings .isDarkMode ? Colors .white : Colors .black,
63
+ ),
64
+ ),
65
+ SizedBox (
66
+ width: 40. w,
67
+ child: SingleChildScrollView (
68
+ scrollDirection: Axis .horizontal,
69
+ child: Row (
70
+ mainAxisAlignment: MainAxisAlignment .center,
71
+ crossAxisAlignment: CrossAxisAlignment .center,
72
+ children: [
73
+ Text (
74
+ projectFilter == ""
75
+ ? "Not selected"
76
+ : projectFilter,
77
+ style: GoogleFonts .firaMono (
78
+ fontSize: 12 ,
79
+ color: AppSettings .isDarkMode
80
+ ? Colors .white
81
+ : Colors .black,
82
+ ),
83
+ ),
84
+ ],
85
+ ),
86
+ ),
87
+ ),
88
+ ],
61
89
),
62
- TextSpan (
63
- text: projectFilter,
64
- style: GoogleFonts .firaMono (
65
- fontSize: 15 ,
66
- color: AppSettings .isDarkMode ? Colors .white : Colors .black,
67
- ),
90
+ ),
91
+ Padding (
92
+ padding: const EdgeInsets .only (left: 10 , right: 10 , top: 10 ),
93
+ child: Row (
94
+ mainAxisAlignment: MainAxisAlignment .center,
95
+ children: [
96
+ Text (
97
+ "All Projecs" ,
98
+ style: GoogleFonts .firaMono (
99
+ fontWeight: FontWeight .w600,
100
+ fontSize: 12 ,
101
+ color:
102
+ AppSettings .isDarkMode ? Colors .white : Colors .black,
103
+ ),
104
+ ),
105
+ ],
68
106
),
69
- ],
70
- ),
71
- ),
72
- backgroundColor: AppSettings .isDarkMode
73
- ? const Color .fromARGB (255 , 48 , 46 , 46 )
74
- : const Color .fromARGB (255 , 220 , 216 , 216 ),
75
- iconColor: AppSettings .isDarkMode ? Colors .white : Colors .black,
76
- collapsedIconColor:
77
- AppSettings .isDarkMode ? Colors .white : Colors .black,
78
- children: projects.isNotEmpty
79
- ? (Map .of (projects)
80
- ..removeWhere ((_, nodeData) => nodeData.parent != null ))
81
- .keys
82
- .map (ProjectTile .new )
83
- .toList ()
84
- : [
85
- Text (
86
- "No Projecs Found" ,
87
- style: TextStyle (
88
- color: (AppSettings .isDarkMode
107
+ ),
108
+ if (projects.isNotEmpty)
109
+ ...projects.entries
110
+ .where ((entry) => entry.value.parent == null )
111
+ .map ((entry) => ProjectTile (entry.key))
112
+ .toList ()
113
+ else
114
+ Column (
115
+ children: [
116
+ Text (
117
+ "No Projects Found" ,
118
+ style: TextStyle (
119
+ color: AppSettings .isDarkMode
89
120
? Colors .white
90
- : const Color .fromARGB (255 , 48 , 46 , 46 )) ,
121
+ : const Color .fromARGB (255 , 48 , 46 , 46 ),
91
122
fontFamily: GoogleFonts .firaMono ().fontFamily,
92
- fontSize: 14 ),
93
- ),
94
- SizedBox (
95
- height: 2. h,
96
- )
97
- ],
98
- ),
99
- );
123
+ fontSize: 14 ,
124
+ ),
125
+ ),
126
+ SizedBox (
127
+ height: 2. h,
128
+ ),
129
+ ],
130
+ ),
131
+ ],
132
+ ));
100
133
}
101
134
}
102
135
@@ -145,19 +178,45 @@ class ProjectTile extends StatelessWidget {
145
178
);
146
179
147
180
return (node.children.isEmpty)
148
- ? ListTile (
149
- leading: radio,
150
- title: title,
181
+ ? GestureDetector (
151
182
onTap: () => callback (project),
152
- tileColor: AppSettings .isDarkMode
153
- ? const Color .fromARGB (255 , 48 , 46 , 46 )
154
- : const Color .fromARGB (255 , 220 , 216 , 216 ),
155
- textColor: AppSettings .isDarkMode
156
- ? Colors .white
157
- : const Color .fromARGB (255 , 48 , 46 , 46 ),
183
+ child: Row (
184
+ children: [
185
+ radio,
186
+ SizedBox (
187
+ width: 45. w,
188
+ child: Text (project,
189
+ maxLines: 3 ,
190
+ style: GoogleFonts .firaMono (
191
+ color: AppSettings .isDarkMode
192
+ ? Colors .white
193
+ : Colors .black)),
194
+ ),
195
+ const SizedBox (
196
+ width: 5 ,
197
+ ),
198
+ Container (
199
+ padding: const EdgeInsets .all (4 ),
200
+ decoration: BoxDecoration (
201
+ color: (AppSettings .isDarkMode
202
+ ? Colors .white
203
+ : const Color .fromARGB (255 , 48 , 46 , 46 )),
204
+ ),
205
+ child: Text (
206
+ (node.children.isEmpty)
207
+ ? '${node .subtasks }'
208
+ : '(${node .tasks }) ${node .subtasks }' ,
209
+ maxLines: 1 ,
210
+ style: GoogleFonts .firaMono (
211
+ color: AppSettings .isDarkMode
212
+ ? Colors .black
213
+ : Colors .white),
214
+ ),
215
+ ),
216
+ ],
217
+ ),
158
218
)
159
219
: ExpansionTile (
160
- // textColor: Theme.of(context).textTheme.subtitle1!.color,
161
220
controlAffinity: ListTileControlAffinity .leading,
162
221
leading: radio,
163
222
title: title,
0 commit comments