existingSourceDirs top-level property
The subset of directories in sourceDirs which actually exist in the current working directory.
Implementation
Set<Directory> get existingSourceDirs => Directory.current
.listSync()
.whereType<Directory>()
.map((d) => Directory(path.relative(d.path)))
.where((d) => sourceDirs.any((sd) => sd.path == d.path))
.toSet();