fromMap static method

Task? fromMap(
  1. Object? body
)

Implementation

static Task? fromMap(Object? body) {
  final source = readRecord(body);
  if (source == null) return null;
  return Task(
    actualHours: readAny(source['actual_hours']),
    code: readText(source['code']),
    completedAt: readText(source['completed_at']),
    completedBy: TaskCompletedBy.fromMap(source['completed_by']),
    createdBy: TaskCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    customAttributes: readList<Object>(source['custom_attributes'], readAny),
    description: readText(source['description']),
    displayName: readText(source['display_name']),
    dueDate: readText(source['due_date']),
    estimatedHours: readInteger(source['estimated_hours']),
    href: readText(source['href']),
    id: readText(source['id']),
    lastUpdatedBy: TaskLastUpdatedBy.fromMap(source['last_updated_by']),
    lastUpdatedOn: readText(source['last_updated_on']),
    milestone: readAny(source['milestone']),
    name: readText(source['name']),
    object: readText(source['object']),
    parentTask: readAny(source['parent_task']),
    priority: readText(source['priority']),
    resource: readAny(source['resource']),
    sortOrder: readInteger(source['sort_order']),
    startAfter: readAny(source['start_after']),
    startDate: readText(source['start_date']),
    state: readAny(source['state']),
    status: readText(source['status']),
    taskStatus: readText(source['task_status']),
    version: readInteger(source['version']),
    workflow: readAny(source['workflow']),
  );
}