modularity_core#
Core implementation of the Modularity dependency-injection framework.
Re-exports everything from modularity_contracts and adds:
- SimpleBinder / SimpleBinderFactory — pure-Dart DI container.
- ModuleController — module lifecycle engine.
- ModuleOverrideScope — hierarchical dependency overrides.
-
GraphResolver/ ModuleRegistryKey — import graph resolution. -
ConsoleLogger
— default logger via
dart:developer.
import 'package:modularity_core/modularity_core.dart';
final controller = ModuleController(AppModule());
await controller.initialize({});
Classes#
| Class | Description |
|---|---|
| ConsoleLogger |
Default
ModularityLogger
that forwards messages to
dart:developer
via
developer.log
.
|
| ModuleController | Manages the full lifecycle of a single Module : dependency resolution, initialization, hot reload, and disposal. |
| ModuleGraphNodeKey | Identity of a module node inside the import graph. |
| ModuleOverrideScope | Hierarchical tree of BinderOverride s that mirrors the module import graph. |
| ModuleRegistryKey | Composite key used in the global module registry to differentiate ModuleController instances by runtime Type , optional module identity, and ModuleOverrideScope . |
| SimpleBinder | Pure-Dart, map-based Binder implementation with no external dependencies. |
| SimpleBinderFactory | Default BinderFactory that produces SimpleBinder instances. |
Typedefs#
| Typedef | Description |
|---|---|
| BinderOverride | Callback that applies dependency overrides to the given Binder . |