Last active
May 12, 2018 11:26
-
-
Save happyharis/4d842a4ce31c28bc637d87a0d868404a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return new StreamBuilder<QuerySnapshot>( | |
stream: Firestore.instance.collection('todo_list').where('finished', isEqualTo: false).snapshots, | |
builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) { | |
if (!snapshot.hasData) return new Text('Loading...'); | |
return new ListView( | |
children: snapshot.data.documents.map((DocumentSnapshot document) { | |
return new ListTile( | |
title: new Row( | |
children: <Widget>[ | |
new Expanded(child: new Text(document['task'])), | |
], | |
) | |
); | |
}).toList(), | |
); | |
}, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment