-
-
Save sbis04/ceeec3d69c4d28c610a46ef8dd045afe to your computer and use it in GitHub Desktop.
This file contains 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
static Future<void> addItem({ | |
required String title, | |
required String description, | |
}) async { | |
DocumentReference documentReferencer = | |
_mainCollection.doc(userUid).collection('items').doc(); | |
Map<String, dynamic> data = <String, dynamic>{ | |
"title": title, | |
"description": description, | |
}; | |
await documentReferencer | |
.set(data) | |
.whenComplete(() => print("Notes item added to the database")) | |
.catchError((e) => print(e)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment