Allow task completion even if signatories are still empty, put an indicator for completed tasks with incomplete details.

This commit is contained in:
2026-02-24 22:08:53 +08:00
parent 892fbee456
commit 546c254326
6 changed files with 212 additions and 23 deletions
+13
View File
@@ -53,6 +53,19 @@ class Task {
// JSON serialized rich text for action taken (Quill Delta JSON encoded)
final String? actionTaken;
/// Helper that indicates whether a completed task still has missing
/// metadata such as signatories or action details. The parameter is used
/// by UI to surface a warning icon/banner when a task has been closed but
/// the user skipped filling out all fields.
bool get hasIncompleteDetails {
if (status != 'completed') return false;
bool empty(String? v) => v == null || v.trim().isEmpty;
return empty(requestedBy) ||
empty(notedBy) ||
empty(receivedBy) ||
empty(actionTaken);
}
factory Task.fromMap(Map<String, dynamic> map) {
return Task(
id: map['id'] as String,