one method
Creates a document in the Realtime database from the given object.
Implementation
@override
Future<void> one(dynamic object, { String? subcollection }) {
final serializer = RDB.serializers[object.runtimeType];
if (serializer == null) {
throw UnsupportedError('No serializer found for type: ${object.runtimeType}. Consider re-generating Firestorm data classes.');
}
final map = serializer(object);
String id = map["id"];
if (id.isEmpty) {
throw NullIDException(map);
}
final reference = RDB.instance.ref(RDB.constructPathForClassAndID(object.runtimeType, object.id, subcollection: subcollection));
return reference.set(map);
}