dart_unused_files
1.0.1, released 8 weeks ago by an unverified publisher
CLI tool to scan Flutter and Dart projects for unused .dart files.
What it does
Scans all Dart files in a Flutter or Dart project, analyzes dependencies and reachability from entry points, and reports unused files that can be safely removed. It supports custom paths, file patterns, and folder exclusions.
AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to clean up dead code and reduce codebase size.
- You are preparing a project for maintenance or a major refactor.
Skip it when
- Your project relies on dynamic file loading or custom reflection that static analysis cannot track.
Strengths
- Accurate detection with built-in default exclusions for generated code.
- Customizable scan paths, file patterns, and folder exclusions.
Weaknesses
- May require manual review to prevent false positives in highly dynamic codebases.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Activate globally via pub using `dart pub global activate dart_unused_files`.
dart_unused_files scan --path /path/to/your/projectAlternatives
Packages that do the same job and could replace dart_unused_files.
- flame_lint
A strict and satisfying lint package for Flame, Flutter, or Dart projects.
73Compare - ciach
Dead code detector for Dart and Flutter that finds and removes unused declarations.
80Compare - patrol_cli
Command-line tool to run and debug Patrol UI tests on multiple platforms
89Compare - flint
Stricter analyzer lint rules used in Forus Labs' Dart & Flutter projects.
78Compare
Works with
Packages commonly used together with dart_unused_files: ones it builds on, ones built on it, and its own family.