Skip to content
pubscout

dependency_validator

5.1.0, released 2 months ago by workiva.com

Validates missing, under‑promoted, over‑promoted and unused dependencies in a Dart package.

$ flutter pub add dependency_validator
Source repository

What it does

The tool scans a package's source files and pubspec to find dependencies that are missing, declared only as dev_dependencies, over‑declared, or never used. It supports hook scripts, workspaces and configurable ignore/exclude rules.

AI-written summary of version 5.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to keep pubspec.yaml accurate and avoid bloated or broken dependencies
  • Running CI checks for dependency hygiene in monorepos or single packages
  • Before publishing a package to ensure all dependencies are correctly declared

Skip it when

  • You need runtime dependency management inside the app
  • You prefer IDE‑integrated linting over a separate CLI tool

Strengths

  • Detects multiple dependency issues in one run
  • Supports Pub Workspaces and hook directories
  • Configurable ignore and exclude patterns

Weaknesses

  • CLI‑only, no IDE integration
  • May miss dynamically loaded packages
  • Limited to Dart packages, not a Flutter widget library

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
13

Run `dart pub global activate dependency_validator` and then `dart pub global run dependency_validator`

dart pub global activate dependency_validator
dart pub global run dependency_validator

Works with

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