Future<void> toggleTask(Task task) async { task.isCompleted = !task.isCompleted; state = [...state]; await _saveTasks(); }