pathSegments property

List<String> get pathSegments

The full path segments of the reference, in order, including the document ID if it's not null.

Implementation

List<String> get pathSegments {
  if (collection == null) {
    throw StateError(
      '[DataRefModelExtension] Invalid collection: Collection cannot be null.',
    );
  }
  final segments = [...?collection, id].nonNulls.toList();
  if (segments.isEmpty) {
    throw StateError(
      '[DataRefModelExtension] Invalid path: Path segments cannot be empty.',
    );
  }
  return segments;
}