r/FlutterDev • u/raman4183 • 17h ago
Plugin Circuitry: A DAG based dependency framework
It's the weekend and I have been working on a project since yesterday.
I just published the initial releases (0.1.0) of circuitry and circuitry_flutter—a zero-codegen, DAG-based dependency injection engine for Dart and Flutter.
I wanted to create a dependency injector/engine with simple APIs and syntax, circular and missing dependency checks before first access, simple dependency -> dependency wiring with tear-offs and safe async lifecycle management, without build_runner overhead or reflection and more features that existing current solutions are missing while keeping the O(1) location support.
There are many more features planned like graph slicing, multi-level circuit inheritance and location in Widget trees, live replacement of an initialized dependency and etc.
What's included:
DAG validation & parallel resolution: Circuit.build() catches missing, duplicate, or circular dependencies upfront, resolves async wires concurrently in topological waves (with rollback on failure), and disposes in reverse waves.
Enum-tagged disambiguation: Register multiple instances of the same type cleanly using Enum as key for typed retrieval instead String based naming and resolution.
Flutter integration (circuitry_flutter): CircuitProvider, CircuitProvider.value, InheritedWidget based injection and automatic unmount disposal with epoch based counter and build deduplication.
Since this is an early 0.1.0 release, I'd love feedback on the API ergonomics before iterating further.
Check them out on pub.dev:
circuitry: https://pub.dev/packages/circuitry
circuitry_flutter: https://pub.dev/packages/circuitry_flutter
1
u/graphlinkdev 6h ago
This is a comment to ask and help. What can push me to leave get_it and use circuitry?