Skip to content
pubscout

Compare

The strongest value in each row is marked.

Attributeinject_generator

Source code generator for compile-time dependency injection using annotations.

pub.devRemove
injector

A simple to use and lightweight dependency injection library for Dart.

pub.devRemove
ScoresHealth67 (best)50
Maintenance62 (best)2
Quality91100 (best)
Popularity5084 (best)
Community52 (best)34
Compatibility85100 (best)
UsageDownloads (30 days)143k976k (best)
Likes663 (best)
Pub points140 / 160160 / 160 (best)
GitHub stars1475 (best)
MaintenanceLatest release1.2.1, 3 months ago (best)4.0.0, 2 years ago
Major versions in 12 months00
Contributors36 (best)
Publisherdasralph.deUnverified
FitPlatformsAll (pure Dart)All (pure Dart)
WASM-readyNoYes
KindPure DartPure Dart
Code generationYesNo
Direct dependencies140 (best)
LicenseMITAPACHE-2.0
Setup effortMediumLow
JudgementStrengths
  • Zero runtime overhead and no reflection (no dart:mirrors)
  • Compile-time validation catches missing bindings and cycles early
  • Strong Flutter integration via inject_flutter and ViewModelFactory
  • Simple and lightweight
  • Supports both dependencies (new instance each time) and singletons
  • Lazy loading of instances by default
Weaknesses
  • Requires running build_runner after annotation changes
  • Generated code adds build artifacts to your project
  • Requires absolute imports for dependencies to avoid issues
  • Does not handle complex dependency graphs automatically without manual wiring
WarningsNoneNone
inject_generator vs injector: which Flutter package should you use? | pubscout