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/902240b134f58535f5c0542115866b45 to your computer and use it in GitHub Desktop.
Save ijoschek/902240b134f58535f5c0542115866b45 to your computer and use it in GitHub Desktop.
flutter_firestore_tut
//...
class _Home extends State<StatefulWidget> {
//...
void clickWrite() async {
if (_myContr.text.isNotEmpty) {
await Firestore.instance
.collection('docs')
.document()
.setData({'text': _myContr.text});
_myContr.text = '';
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