fromJson static method

InputChecklist? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static InputChecklist? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return InputChecklist(
    title: FormattedText.fromJson(json['title'] as Map<String, dynamic>?)!,
    tasks: List<InputChecklistTask>.from(
        ((json['tasks'] as List<dynamic>?) ?? <dynamic>[])
            .map((item) =>
                InputChecklistTask.fromJson(item as Map<String, dynamic>?))
            .toList()),
    othersCanAddTasks: (json['others_can_add_tasks'] as bool?) ?? false,
    othersCanMarkTasksAsDone:
        (json['others_can_mark_tasks_as_done'] as bool?) ?? false,
  );
}