Created
March 5, 2020 10:08
-
-
Save xinthink/e8f2a9fc6671bc6e139fa34d76aa2db7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
extension NoteStore on Note { | |
/// Save this note to FireStore. | |
Future<dynamic> saveToFireStore(String uid) async { | |
final col = notesCollection(uid); | |
return id == null | |
? col.add(toJson()) | |
: col.document(id).updateData(toJson()); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment