Skip to content

Instantly share code, notes, and snippets.

@ijoschek
Last active December 5, 2018 09:01
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 ijoschek/d0f5c68a16a7cd905f18d0f256e66a7d to your computer and use it in GitHub Desktop.
Save ijoschek/d0f5c68a16a7cd905f18d0f256e66a7d to your computer and use it in GitHub Desktop.
flutter_firestore_tut
//...
class _Home extends State<StatefulWidget> {
//...
void clickGet() async {
if (_getContr.text.isNotEmpty) {
var query = await Firestore.instance
.collection('docs')
.where('text', isEqualTo: _getContr.text)
.getDocuments();
setState(() {
_queriedDocs = query.documents.length;
});
interact();
}
}
//...
@override
Widget build(BuildContext context) {
return Scaffold(
//...
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment