FirestoreDocumentPath.fromPath constructor

FirestoreDocumentPath.fromPath(
  1. PathSegment pathSegment
)

Implementation

factory FirestoreDocumentPath.fromPath(PathSegment pathSegment) {
  if (pathSegment.parent == null) {
    throw ArgumentError('Document paths must have a collection parent');
  }
  return FirestoreDocumentPath(pathSegment.segment,
      FirestoreCollectionPath.fromPath(pathSegment.parent!));
}