collection method

  1. @override
CollectionReference<Map<String, dynamic>> collection(
  1. String path
)
override

Gets a CollectionReference for the specified Firestore path.

Implementation

@override
CollectionReference<Map<String, dynamic>> collection(String path) {
  final segments = path.split('/');
  assert(segments.length % 2 == 1,
      'Invalid document reference. Collection references must have an odd number of segments');
  return MockCollectionReference<Map<String, dynamic>>(
      this,
      path,
      getSubpath(_root, path),
      _docsData,
      getSubpath(_snapshotStreamControllerRoot, path));
}