Added Action Taken on Task
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import '../utils/app_time.dart';
|
||||
|
||||
class Task {
|
||||
@@ -21,6 +23,7 @@ class Task {
|
||||
this.requestType,
|
||||
this.requestTypeOther,
|
||||
this.requestCategory,
|
||||
this.actionTaken,
|
||||
});
|
||||
|
||||
final String id;
|
||||
@@ -45,6 +48,8 @@ class Task {
|
||||
final String? requestType;
|
||||
final String? requestTypeOther;
|
||||
final String? requestCategory;
|
||||
// JSON serialized rich text for action taken (Quill Delta JSON encoded)
|
||||
final String? actionTaken;
|
||||
|
||||
factory Task.fromMap(Map<String, dynamic> map) {
|
||||
return Task(
|
||||
@@ -70,6 +75,16 @@ class Task {
|
||||
requestedBy: map['requested_by'] as String?,
|
||||
notedBy: map['noted_by'] as String?,
|
||||
receivedBy: map['received_by'] as String?,
|
||||
actionTaken: (() {
|
||||
final at = map['action_taken'];
|
||||
if (at == null) return null;
|
||||
if (at is String) return at;
|
||||
try {
|
||||
return jsonEncode(at);
|
||||
} catch (_) {
|
||||
return at.toString();
|
||||
}
|
||||
})(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user