filesNamed function

List<File> filesNamed(
  1. String currentPath,
  2. String dir,
  3. String name
)

Every file called name under <currentPath>/<dir>, found by the walk dartFiles uses — so no link is followed, and hidden directories and a package's build/ output are skipped. The report finds sub-package pubspecs with it: a walk of its own that followed links went through a Flutter app's .plugin_symlinks/ into the pub cache.

Implementation

List<File> filesNamed(String currentPath, String dir, String name) => [
      for (final entity in _readDir(currentPath, dir))
        if (entity is File && _baseName(entity.path) == name) entity,
    ];