Skip to content

Instantly share code, notes, and snippets.

@happyharis
Last active May 12, 2018 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save happyharis/4d842a4ce31c28bc637d87a0d868404a to your computer and use it in GitHub Desktop.
Save happyharis/4d842a4ce31c28bc637d87a0d868404a to your computer and use it in GitHub Desktop.
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