spider
4.2.3, released a year ago by birju.dev
A Dart command-line tool for generating type-safe Dart references for assets.
What it does
Spider scans your asset folders and generates Dart classes with static const variables pointing to your assets. This eliminates string typo errors and provides IDE auto-completion. It also supports generating verification unit tests and watch modes for automatic rebuilding.
AI-written summary of version 4.2.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want type-safe references to project assets instead of hardcoded strings
- You manage a large number of images, vectors, and fonts in your Flutter app
Skip it when
- You prefer dynamic asset loading or standard string paths
Strengths
- Prevents typos when referencing asset paths in code
- Supports custom configuration via YAML or JSON
- Provides watch modes to regenerate references automatically on file changes
Weaknesses
- Requires running a CLI tool or keeping the watcher active
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 12
Activated globally via pub (dart pub global activate spider) or installed via Homebrew.
Widget build(BuildContext context) {
return Image(image: AssetImage(Assets.background));
}Alternatives
Packages that do the same job and could replace spider.
- serverpod_cli
Command line tools for Serverpod.
74Compare - build_cli
Parse command line arguments directly into an annotation class using build_runner or a standalone CLI.
82Compare - swiftgen
A tool for generating bindings that allow interop between Dart and Swift code.
78Compare - vyuh_cli
A command-line interface for the Vyuh Framework to scaffold modular Flutter Apps and features.
76Compare
Works with
Packages commonly used together with spider: ones it builds on, ones built on it, and its own family.
- yamlspider depends on itA Dart library for parsing YAML documents into Dart data structures.
- dart_stylespider depends on itProvides an API and CLI to format Dart source code automatically.
- watcherspider depends on itMonitors file system changes and notifies when files are added, removed, or modified.
- htmlspider depends on itA Dart implementation of an HTML5 parser for strings and bytes.
- argsspider depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- loggingspider depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- sprintfspider depends on itDart implementation of C-style sprintf formatting
- ansicolorspider depends on itAn xterm-256 color support library for changing terminal text colors and backgrounds.