@@ -8,15 +8,18 @@ import 'package:taskwarrior/app/utils/gen/fonts.gen.dart';
88import 'package:taskwarrior/app/utils/themes/theme_extension.dart' ;
99
1010class DescriptionWidget extends StatelessWidget {
11- const DescriptionWidget (
12- {required this .name,
13- required this .value,
14- required this .callback,
15- super .key});
11+ const DescriptionWidget ({
12+ required this .name,
13+ required this .value,
14+ required this .callback,
15+ this .isEditable = true ,
16+ super .key,
17+ });
1618
1719 final String name;
1820 final dynamic value;
1921 final void Function (dynamic ) callback;
22+ final bool isEditable;
2023
2124 @override
2225 Widget build (BuildContext context) {
@@ -25,7 +28,10 @@ class DescriptionWidget extends StatelessWidget {
2528 return Card (
2629 color: tColors.secondaryBackgroundColor,
2730 child: ListTile (
28- textColor: tColors.primaryTextColor,
31+ enabled: isEditable,
32+ textColor: isEditable
33+ ? tColors.primaryTextColor
34+ : tColors.primaryDisabledTextColor,
2935 title: SingleChildScrollView (
3036 scrollDirection: Axis .horizontal,
3137 child: Row (
@@ -46,7 +52,9 @@ class DescriptionWidget extends StatelessWidget {
4652 fontFamily: FontFamily .poppins,
4753 fontWeight: TaskWarriorFonts .bold,
4854 fontSize: TaskWarriorFonts .fontSizeMedium,
49- color: tColors.primaryTextColor,
55+ color: isEditable
56+ ? tColors.primaryTextColor
57+ : tColors.primaryDisabledTextColor,
5058 ),
5159 ),
5260 TextSpan (
@@ -60,7 +68,9 @@ class DescriptionWidget extends StatelessWidget {
6068 style: TextStyle (
6169 fontFamily: FontFamily .poppins,
6270 fontSize: TaskWarriorFonts .fontSizeMedium,
63- color: tColors.primaryTextColor,
71+ color: isEditable
72+ ? tColors.primaryTextColor
73+ : tColors.primaryDisabledTextColor,
6474 ),
6575 ),
6676 ],
@@ -94,7 +104,6 @@ class DescriptionWidget extends StatelessWidget {
94104 actions: [
95105 TextButton (
96106 onPressed: () {
97- // Navigator.of(context).pop();
98107 Get .back ();
99108 },
100109 child: Text (
@@ -108,7 +117,6 @@ class DescriptionWidget extends StatelessWidget {
108117 onPressed: () {
109118 try {
110119 callback (controller.text);
111- // Navigator.of(context).pop();
112120 Get .back ();
113121 } on FormatException catch (e, trace) {
114122 logError (e, trace);
@@ -131,15 +139,18 @@ class DescriptionWidget extends StatelessWidget {
131139}
132140
133141class ProjectWidget extends StatelessWidget {
134- const ProjectWidget (
135- {required this .name,
136- required this .value,
137- required this .callback,
138- super .key});
142+ const ProjectWidget ({
143+ required this .name,
144+ required this .value,
145+ required this .callback,
146+ this .isEditable = true ,
147+ super .key,
148+ });
139149
140150 final String name;
141151 final dynamic value;
142152 final void Function (dynamic ) callback;
153+ final bool isEditable;
143154
144155 @override
145156 Widget build (BuildContext context) {
@@ -148,7 +159,10 @@ class ProjectWidget extends StatelessWidget {
148159 return Card (
149160 color: tColors.secondaryBackgroundColor,
150161 child: ListTile (
151- textColor: tColors.primaryTextColor,
162+ enabled: isEditable,
163+ textColor: isEditable
164+ ? tColors.primaryTextColor
165+ : tColors.primaryDisabledTextColor,
152166 title: SingleChildScrollView (
153167 scrollDirection: Axis .horizontal,
154168 child: Row (
@@ -169,7 +183,9 @@ class ProjectWidget extends StatelessWidget {
169183 fontFamily: FontFamily .poppins,
170184 fontWeight: TaskWarriorFonts .bold,
171185 fontSize: TaskWarriorFonts .fontSizeMedium,
172- color: tColors.primaryTextColor,
186+ color: isEditable
187+ ? tColors.primaryTextColor
188+ : tColors.primaryDisabledTextColor,
173189 ),
174190 ),
175191 TextSpan (
@@ -183,7 +199,9 @@ class ProjectWidget extends StatelessWidget {
183199 style: TextStyle (
184200 fontFamily: FontFamily .poppins,
185201 fontSize: TaskWarriorFonts .fontSizeMedium,
186- color: tColors.primaryTextColor,
202+ color: isEditable
203+ ? tColors.primaryTextColor
204+ : tColors.primaryDisabledTextColor,
187205 ),
188206 ),
189207 ],
@@ -217,7 +235,6 @@ class ProjectWidget extends StatelessWidget {
217235 actions: [
218236 TextButton (
219237 onPressed: () {
220- // Navigator.of(context).pop();
221238 Get .back ();
222239 },
223240 child: Text (
@@ -232,7 +249,6 @@ class ProjectWidget extends StatelessWidget {
232249 try {
233250 callback (
234251 (controller.text == '' ) ? null : controller.text);
235- // Navigator.of(context).pop();
236252 Get .back ();
237253 } on FormatException catch (e, trace) {
238254 logError (e, trace);
0 commit comments