dirs function
Create a FileCollection consisting of multiple directories, possibly filtering which files within each directory may be included.
If fileExtensions
is not empty, only files with such extensions are
resolved.
Files and directory names can be excluded by providing exclusions
.
If recurse
is set to true
(the default), child directories are included.
If includeHidden
is set to true
(default is false
), files and
directories starting with a .
are included, otherwise they are ignored.
The provided directories must be disjoint and unique, otherwise an ArgumentError is thrown.
Only relative (to the root project directory) directories are allowed by default. Using absolute paths may cause builds to become unportable.
Implementation
FileCollection dirs(
Iterable<String> directories, {
Set<String> fileExtensions = const {},
Set<String> exclusions = const {},
bool recurse = true,
bool includeHidden = false,
bool allowAbsolutePaths = false,
}) =>
_FileCollection(
const {},
List.unmodifiable(_ensureValidDirs(
directories.map((d) => DirectoryEntry(
path: d,
fileExtensions: fileExtensions,
exclusions: exclusions,
recurse: recurse,
includeHidden: includeHidden)),
allowAbsolutePaths: allowAbsolutePaths)));