copyWith method

Checklist copyWith({
  1. FormattedText? title,
  2. List<ChecklistTask>? tasks,
  3. bool? othersCanAddTasks,
  4. bool? canAddTasks,
  5. bool? othersCanMarkTasksAsDone,
  6. bool? canMarkTasksAsDone,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

Checklist copyWith({
  FormattedText? title,
  List<ChecklistTask>? tasks,
  bool? othersCanAddTasks,
  bool? canAddTasks,
  bool? othersCanMarkTasksAsDone,
  bool? canMarkTasksAsDone,
}) => Checklist(
  title: title ?? this.title,
  tasks: tasks ?? this.tasks,
  othersCanAddTasks: othersCanAddTasks ?? this.othersCanAddTasks,
  canAddTasks: canAddTasks ?? this.canAddTasks,
  othersCanMarkTasksAsDone:
      othersCanMarkTasksAsDone ?? this.othersCanMarkTasksAsDone,
  canMarkTasksAsDone: canMarkTasksAsDone ?? this.canMarkTasksAsDone,
);