Skip to content
pubscout

dart_depcheck

2.0.3, released 5 months ago by an unverified publisher

Command-line tool and library to check for unused and missing dependencies in Flutter or Dart projects.

$ flutter pub add dart_depcheck
Source repository

What it does

Analyzes project source files and pubspec.yaml to identify unused dependencies, unused dev dependencies, and missing dependencies. Can be used via CLI or programmatically in Dart code.

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

Use it when

  • You want to clean up unused dependencies in your pubspec.yaml
  • You need to detect missing dependencies imported in source files but not declared
  • You want to check dependency health in continuous integration (CI) pipelines

Skip it when

  • Your project relies heavily on runtime-only packages that have no importable API

Strengths

  • Supports both CLI and programmatic usage
  • Can fail builds in CI using the --fail-on-issues flag
  • Provides JSON and summary output formats for automation

Weaknesses

  • Detection is import-based and may flag packages with no importable API as unused
  • Only scans the lib folder by default unless additional folders are specified

Setup

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

Install globally via 'dart pub global activate dart_depcheck' or add it as a dependency in your project.

import 'package:dart_depcheck/dart_depcheck.dart';

void main() async {
  final result = await DependencyChecker.analyze(
    projectPath: '/path/to/project',
  );
  print(result.isClean);
}

Alternatives

Packages that do the same job and could replace dart_depcheck.

  • pubviz

    A tool to visualize package dependencies and version constraints in your Dart project.

  • flutterflow_cli

    Command-line client for FlutterFlow to export code and build apps with AI.

  • license_checker

    A tool to view and check the licenses of a package's dependencies.

Works with

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