Skip to content

Instantly share code, notes, and snippets.

@Gogetter
Created February 26, 2019 20:59
Show Gist options
  • Select an option

  • Save Gogetter/20079a4352fdfc28a4e179ca3181616e to your computer and use it in GitHub Desktop.

Select an option

Save Gogetter/20079a4352fdfc28a4e179ca3181616e to your computer and use it in GitHub Desktop.
static void saveOrUpdateVisitor(final Visitor visitor, final bool signIn) async {
if (visitor != null) {
// _firestore is a private variable declared using -> static Firestore _firestore = Firestore.instance;
await _firestore.collection(Constants.visitors)/// create the collection where Visitors will be saved
.document(visitor.emailAddress)/// construct a path (more like reference)
.setData(Visitor.toMap(visitor, signIn));/// save data
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment