CollectionReference constructor

CollectionReference(
  1. FirestoreGateway gateway,
  2. String path
)

Constructs a CollectionReference using FirestoreGateway and path.

Throws Exception if path contains odd amount of '/'.

Implementation

CollectionReference(this.gateway, String path) : super(gateway, path) {
  if (fullPath.split('/').length % 2 == 1) {
    throw Exception('Path is not a collection: $path');
  }
}