Skip to content

Instantly share code, notes, and snippets.

@corelmax
Last active January 10, 2021 16:44
Show Gist options
  • Save corelmax/a8f1000296fcccb7aeb92da85914a38e to your computer and use it in GitHub Desktop.
Save corelmax/a8f1000296fcccb7aeb92da85914a38e to your computer and use it in GitHub Desktop.
@@ -14,12 +14,13 @@
return ListView.builder(
itemCount: todos.length,
itemBuilder: (context, index) {
+ var item = todos.entries.elementAt(index).value;
return Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
- Checkbox(value: false, onChanged: (value) {
+ Checkbox(value: item.isDone, onChanged: (value) {
// we will update todo item here
}),
Expanded(
@@ -31,7 +32,7 @@
},
child: TextField(
controller: TextEditingController(
- text: 'todo text is here',
+ text: item.title,
),
onChanged: (String text) {
// update todo's title here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment