isToolPath static method
Whether relative is inside a folder tools make — .dart_tool,
.git or .idea at any depth, build at the top — or is a pub
lockfile or Flutter's plugin list.
Implementation
static bool isToolPath(String relative) {
final parts = relative.split('/');
// A package's own build output is `build/` at its root; a `build`
// folder deeper down is the package's content.
return parts.first == 'build' ||
parts.any((p) => const {'.dart_tool', '.git', '.idea'}.contains(p)) ||
relative == 'pubspec.lock' ||
relative == '.flutter-plugins' ||
relative == '.flutter-plugins-dependencies';
}