collection method

CollectionReference<Map<String, dynamic>> collection(
  1. Type type, {
  2. String? subcollection,
})

Returns a reference to a collection using its class.

Implementation

CollectionReference<Map<String, dynamic>> collection(Type type, { String? subcollection }) {
  if (subcollection != null) {
    return FS.instance.collection(type.toString()).doc(subcollection).collection(subcollection);
  }
  return FS.instance.collection(type.toString());
}