Task.fromJson constructor
Implementation
factory Task.fromJson(Map<String, Object?> json) {
return Task(
id: json[r'id'],
localId: json[r'localId'],
spaceId: json[r'spaceId'],
pageId: json[r'pageId'],
blogPostId: json[r'blogPostId'],
status: json[r'status'] != null
? TaskStatus.fromValue(json[r'status']! as String)
: null,
body: json[r'body'] != null
? BodySingle.fromJson(json[r'body']! as Map<String, Object?>)
: null,
createdBy: json[r'createdBy'] as String?,
assignedTo: json[r'assignedTo'] as String?,
completedBy: json[r'completedBy'] as String?,
createdAt: DateTime.tryParse(json[r'createdAt'] as String? ?? ''),
updatedAt: DateTime.tryParse(json[r'updatedAt'] as String? ?? ''),
dueAt: DateTime.tryParse(json[r'dueAt'] as String? ?? ''),
completedAt: DateTime.tryParse(json[r'completedAt'] as String? ?? ''),
);
}