Hi I have a list of Daytile objects and I want to remove them based on an AlertDialog that asks the user to input the name of the dayTile they want to remove. However, even when inputting the name exactly as it is, the element is never removed from the list.
Removal Logic
TextFormField(controller: titleController, inputFormatters: [
LengthLimitingTextInputFormatter(14),
]),
...
TextButton(
onPressed: () async {
setState(() {
dayTiles.remove(
DayTile(title: titleController.text));
// print(dayTiles);
});
saveData();
Navigator.pop(context);
},
child: const Text("Remove")),
Thank You!