I'm making a todo app and don't know what is going bad on this. The user can push the button as many time as he want and I want only to function once. How can I do?
onTap: () {
isComplet = !isComplet;
if (Todo().isComplet = true) {
DatabaseService().completTask(todos[index].uid);
}
if (Todo().isComplet = false) {
DatabaseService().uncompletTask(todos[index].uid);
}
},
I posted before the entire code. If it can help, here's the link to the other question. Thanks!
How can I make that the on ttap button only be pressed one time? - Flutter