Added validation when task type, category, signatories and action taken are empty upon completing a task

This commit is contained in:
2026-02-23 21:27:55 +08:00
parent 1074572905
commit 98355c3707
3 changed files with 90 additions and 12 deletions
+10 -3
View File
@@ -2731,9 +2731,16 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
// Update DB only — Supabase realtime stream will emit the
// updated task list, so explicit invalidation here causes a
// visible loading/refresh and is unnecessary.
await ref
.read(tasksControllerProvider)
.updateTaskStatus(taskId: task.id, status: value);
try {
await ref
.read(tasksControllerProvider)
.updateTaskStatus(taskId: task.id, status: value);
} catch (e) {
// surface validation or other errors to user
if (mounted) {
showErrorSnackBar(context, e.toString());
}
}
},
itemBuilder: (context) => _statusOptions
.map(