update method
Updates the document referenced by ref with the current data.
If refe
is provided, it sets the ref to the new reference.
Implementation
Future<void> update([DocumentReference? refe]) async {
if (refe != null) {
if (ref != null) {
throw 'Document reference is already set';
}
ref = refe;
}
if (ref == null) {
throw 'Document reference is null';
}
await ref!.set(toMap());
}