collection method

CollectionReference<Map<String, dynamic>> collection(
  1. String collectionPath
)

Gets a CollectionReference for the specified Firestore path.

Implementation

CollectionReference<Map<String, dynamic>> collection(String collectionPath) {
  assert(
    collectionPath.isNotEmpty,
    'a collectionPath path must be a non-empty string',
  );
  assert(
    !collectionPath.contains('//'),
    'a collection path must not contain "//"',
  );
  assert(
    isValidCollectionPath(collectionPath),
    'a collection path must point to a valid collection.',
  );

  return _JsonCollectionReference(this, _delegate.collection(collectionPath));
}