@@ -48,13 +48,13 @@ class TaskcDetailsController extends GetxController {
4848 status = task.status.obs;
4949 priority = (task.priority ?? '-' ).obs;
5050 due = formatDate (task.due).obs;
51- start = formatDate (task.start) .obs;
52- wait = formatDate (task.wait) .obs;
53- tags = (task.tags ?? [] ).obs;
54- depends = (task.depends ?? [] ).obs;
55- rtype = (task.rtype ?? '-' ) .obs;
56- recur = (task.recur ?? '-' ) .obs;
57- annotations = (task.annotations ?? []) .obs;
51+ start = "" .obs;
52+ wait = "" .obs;
53+ tags = "" . split ( "," ).obs;
54+ depends = "" . split ( "," ).obs;
55+ rtype = "" .obs;
56+ recur = "" .obs;
57+ annotations = < Annotation > [] .obs;
5858 }
5959
6060 String formatDate (String ? dateString) {
@@ -86,30 +86,30 @@ class TaskcDetailsController extends GetxController {
8686 }
8787
8888 Future <void > saveTask () async {
89- final updatedTask = TaskForC (
90- id: initialTask.id,
91- description: description.value,
92- project: project.value == '-' ? null : project.value,
93- status: status.value,
94- uuid: initialTask.uuid,
95- urgency: initialTask.urgency, // Urgency is typically calculated
96- priority: priority.value == '-' ? null : priority.value,
97- due: due.value == '-' ? null : due.value,
98- start: start.value == '-' ? null : start.value,
99- end: initialTask.end, // 'end' is usually set when completed
100- entry: initialTask.entry, // 'entry' is static
101- wait: wait.value == '-' ? null : wait.value,
102- modified: DateFormat ('yyyy-MM-dd HH:mm:ss' )
103- .format (DateTime .now ()), // Update modified time
104- tags: tags.isEmpty ? null : tags.toList (),
105- depends: depends.isEmpty ? null : depends.toList (),
106- rtype: rtype.value == '-' ? null : rtype.value,
107- recur: recur.value == '-' ? null : recur.value,
108- annotations: annotations.isEmpty ? null : annotations.toList (),
89+ if (tags.length == 1 && tags[0 ] == "" ) {
90+ tags.clear ();
91+ }
92+ await taskDatabase.saveEditedTaskInDB (
93+ initialTask.uuid! ,
94+ description.string,
95+ project.string,
96+ status.string,
97+ priority.string,
98+ due.string,
99+ tags.toList (),
109100 );
110- await TaskDatabase ().updateTask (updatedTask);
111101 hasChanges.value = false ;
112- await modifyTaskOnTaskwarrior (updatedTask);
102+ debugPrint ('Task saved in local DB ${description .string }' );
103+ await modifyTaskOnTaskwarrior (
104+ description.string,
105+ project.string,
106+ due.string,
107+ priority.string,
108+ status.string,
109+ initialTask.uuid! ,
110+ initialTask.id.toString (),
111+ tags.toList (),
112+ );
113113 }
114114
115115 Future <bool > handleWillPop () async {
0 commit comments