collectionPath property

String? get collectionPath

The full collection path of the reference, always ending in "/".

Implementation

String? get collectionPath {
  if (collection == null || collection!.isEmpty) {
    return null;
  }
  // Collection segments must be odd
  if (collection!.length.isEven) {
    throw StateError(
      '[DataRefModelExtension] Invalid collection path: Collection must have an odd number of segments.',
    );
  }
  return '${collection!.join('/')}/';
}