add method
Returns a DocumentReference
with an auto-generated ID, after
populating it with provided data
.
The unique key generated is prefixed with a client-generated timestamp so that the resulting list will be chronologically-sorted.
Implementation
Future<DocumentReference> add(Map<String, dynamic> data) async {
final DocumentReference newDocument = doc();
await newDocument.set(data);
return newDocument;
}