dir function

DirectoryDescriptor dir(
  1. String name, [
  2. Iterable<Descriptor>? contents
])

Creates a new DirectoryDescriptor descriptor with name and contents.

Descriptor.validate requires that all descriptors in contents match children of the physical diretory, but it doesn't require that no other children exist. To ensure that a particular child doesn't exist, use nothing.

Implementation

DirectoryDescriptor dir(String name, [Iterable<Descriptor>? contents]) =>
    DirectoryDescriptor(name, contents ?? <Descriptor>[]);