create method
Creates a new document in the specified CollectionReference
and sets the ref to the newly created document.
Implementation
Future<void> create(CollectionReference d) async {
if (ref != null) {
throw 'Document reference is already set';
}
ref = d.doc();
await ref!.set(toMap());
}