Skip to content
pubscout

spider

4.2.3, released a year ago by birju.dev

A Dart command-line tool for generating type-safe Dart references for assets.

$ flutter pub add spider
Source repository

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.

  • build_cli

    Parse command line arguments directly into an annotation class using build_runner or a standalone CLI.

  • swiftgen

    A tool for generating bindings that allow interop between Dart and Swift code.

  • vyuh_cli

    A command-line interface for the Vyuh Framework to scaffold modular Flutter Apps and features.

Works with

Packages commonly used together with spider: ones it builds on, ones built on it, and its own family.