I want the new tasks to be added at the bottom of the task list. Not at the bottom: void…
- User
I want the new tasks to be added at the bottom of the task list. Not at the bottom: void _addTask(String taskText) { setState(() { String trimmedText = taskText.trim(); if (trimmedText.isNotEmpty && !_isDuplicate(trimmedText)) { final newTask = Task(titulo: trimmedText, ordem: taskList.length + 1); taskList.insert(0, newTask); _listKey.currentState?.insertItem(0); textController.clear(); } }); }
- Assistant
To add new tasks at the bottom of the task list instead of the top, you need to modify the part of your code where you're inserting new tasks into
taskListand updating the list view.Currently, you're using:
darttaskList.insert(0, newTask); _listKey.currentState?.insertItem(0);