asset_tree_shaker
A build-time tool that detects and removes unused assets from Flutter projects. Uses AST analysis to accurately identify asset references in Dart code.
What this package is like to depend on
Last release 7 months ago
30 Dec 2025
Too new to tell
only 1 release windows
Nearly every release is documented
notes for 4 of 4 stable releases
Nothing withdrawn
no release was ever pulled
7 months old
4 releases · first in 2025
4 releases in the last 12 months
see the full history below
Release timeline
4 releases · Dec 2025 to Dec 2025Releases
latest 4-
1.1.230 Dec 2025Release notes
Open source →Added
- Complete Documentation - Updated README.md with all commands and proper version references
- Changelog Documentation - Full list of available commands in CHANGELOG
Changed
- Updated installation version reference to ^1.1.0
- Reorganized README with
checkcommand as primary recommendation - Added detailed examples for all command options
-
1.1.130 Dec 2025Release notes
Open source →Added
- Comprehensive Documentation - Updated README with all commands and version numbers
- Author Information - Added author email ([email protected])
Commands Available (v1.1.1)
check- All-in-one analysis, reporting, and cleanup with interactive promptanalyze- Analyze and report unused assetsreport- Generate detailed reports (Markdown, JSON, HTML)clean- Remove unused assets with backupinit- Create default configurationrestore- Restore from backup
-
1.1.030 Dec 2025Release notes
Open source →Added
- New
checkCommand - All-in-one command for asset analysis- Shows all assets with visual used/unused status indicators
- Displays file sizes and colored status labels
- Automatically generates markdown report
- Interactive prompt to clean unused assets
- Summary with potential savings
- New
-
1.0.030 Dec 2025Release notes
Open source →Added
-
Asset Discovery - Parse
pubspec.yamlto list all declared assets- Support for direct file paths
- Support for directory declarations (trailing
/) - Support for glob patterns (
*.png,**/*.json)
-
AST-Based Usage Scanner - Scan Dart files using the
analyzerpackage- Detect string literals matching asset paths
- Detect string interpolation (
'assets/$name.png') - Detect string concatenation (
'assets/' + name + '.png') - Detect adjacent strings (
'assets/' 'image.png') - Ignore asset references in comments
-
Graph Analysis - Compare declared vs. used assets
- Identify unused assets
- Support for whitelist patterns via configuration
- Support for dynamic pattern matching
- Support for
@KeepAssetannotations
-
Report Generation - Multiple output formats
- Markdown reports
- JSON reports (for CI/CD integration)
- HTML reports (for visual review)
-
Asset Cleaning - Safely remove unused assets
- Dry-run mode for preview
- Automatic backup before deletion
- Restore command for recovery
- Optional pubspec.yaml cleanup
-
CLI Tool - Full-featured command-line interface
analyze- Detect unused assetsclean- Remove unused assetsreport- Generate detailed reportsinit- Create configuration filerestore- Recover from backup
-
CI/CD Integration - Strict mode for build pipelines
- Exit code 1 when unused assets found
- JSON output for automated processing
-
Configuration System - YAML-based configuration
- Customizable scan paths
- Exclude patterns (glob)
- Dynamic patterns (glob)
- Annotation configuration
-