I have a To Do List with things to do daily like 'Drink Water' and so on. So now I want that when the user has checked a To Do, the next day it should be unchecked again. How can I implement this?
Right now my Code looks like this:
class ToDoScreen extends StatefulWidget {
const ToDoScreen({Key key}) : super(key: key);
@override
_ToDoScreenState createState() => _ToDoScreenState();
}
class _ToDoScreenState extends State<ToDoScreen> {
List toDos = ['Train Today', 'Drink Water'];
bool value = false;
void addToDo(String newToDo) {
setState(() {
toDos.add(newToDo);
});
Navigator.of(context).pop();
}
void newEntry() {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
content: TextField(
onSubmitted: addToDo,
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10)),
icon: Icon(Icons.text_snippet_outlined),
labelText: 'New To Do'),
),
);
});
}