Drop files into assets/ and get everything updated automatically
Pubspec entries, type-safe Dart code, and more.
Seven commands. One tool. Every asset problem you've quietly tolerated—solved in seconds.
Add an image, delete a font, rename an icon—pubspec.yaml and your generated code gets updated in real time. No restarts.
Every asset gets a const String in a generated Dart file. Autocomplete supported &
typos become compile errors.
Compress PNGs and JPEGs with one command. Configurable quality. Dry-run mode so you see savings before committing.
Scans every .dart file in lib/ to find assets nobody references. Shows
file sizes so you know what to cut first.
Missing files, stale generated code, oversized assets — check catches it all and
returns non-zero so your pipeline breaks early.
New to a project? doctor scans your setup — pubspec, assets folder, flutter config,
generated code — and tells you exactly what's off.
One command, and your project stays in sync.
Every asset in your project becomes a type-safe constant. Drop a file in, reference it by name.
The generated class updates automatically when you run watch or gen.
// GENERATED CODE - DO NOT MODIFY BY HAND
class Assets {
Assets._();
static const String logo = 'assets/images/logo.png';
static const String banner = 'assets/images/banner.png';
static const String homeIcon = 'assets/icons/home.svg';
static const String config = 'assets/data.json';
static const List<String> all = [
logo, banner, homeIcon, config,
];
}
dart pub global activate dart_assetscd your_flutter_project && dart_assets watchDrop files into assets/. Pubspec updates. Code regenerates.
Hot reload picks it up. And its all done!
dart_assets watch
Watch assets folder, auto-update pubspec + code on changes
dart_assets gen
One-time code generation for type-safe asset references
dart_assets optimize
Compress images for production (supports --dry-run)
dart_assets unused
Find assets not referenced anywhere in your Dart code
dart_assets clean
Remove unused assets and update pubspec in one step
dart_assets check
Validate everything — CI-friendly with proper exit codes
dart_assets doctor
Diagnose common config issues and missing setup