Task.fromJson constructor

Task.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory Task.fromJson(Map<String, Object?> json) {
  return Task(
    globalId: (json[r'globalId'] as num?)?.toInt() ?? 0,
    id: (json[r'id'] as num?)?.toInt() ?? 0,
    contentId: (json[r'contentId'] as num?)?.toInt() ?? 0,
    status: json[r'status'] as String? ?? '',
    title: json[r'title'] as String?,
    description: json[r'description'] as String?,
    body: json[r'body'] as String?,
    creator: json[r'creator'] as String? ?? '',
    assignee: json[r'assignee'] as String?,
    completeUser: json[r'completeUser'] as String?,
    createDate: (json[r'createDate'] as num?)?.toInt() ?? 0,
    dueDate: (json[r'dueDate'] as num?)?.toInt(),
    updateDate: (json[r'updateDate'] as num?)?.toInt(),
    completeDate: (json[r'completeDate'] as num?)?.toInt(),
    links: json[r'_links'] != null
        ? GenericLinks.fromJson(json[r'_links']! as Map<String, Object?>)
        : null,
  );
}