Allow task completion even if signatories are still empty, put an indicator for completed tasks with incomplete details.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user