collection method

DatabaseReference collection(
  1. Type type, {
  2. String? subcollection,
})

Returns a reference to a collection using its class.

Implementation

DatabaseReference collection(Type type, { String? subcollection }) {
  final String? className = RDB.classNames[type];
  if (className == null) {
    throw UnsupportedError('No class name found for type: $type. Consider re-generating Firestorm data classes.');
  }
  return RDB.instance.ref(RDB.constructPathForClass(className, subcollection: subcollection));
}