Added validation when task type, category, signatories and action taken are empty upon completing a task
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user