levit_scope library
Type-safe hierarchical dependency injection and lifecycle runtime for Dart.
This package provides Levit's DI container model:
- LevitScope for scoped registration, resolution, and deterministic teardown.
- LevitScopeDisposable for dependencies with explicit init/close callbacks.
- LevitScopeMiddleware for interception of DI lifecycle events.
levit_scope is reflection-free and relies on explicit types, tags, and
scope boundaries.
Classes
-
LevitDependency<
S> - Metadata container for a dependency registered within a LevitScope.
- LevitScope
- A hierarchical dependency injection container.
- LevitScopeDisposable
- An interface for objects that participate in the LevitScope lifecycle.
- LevitScopeKey
- Typed key for dependency registrations.
- LevitScopeMiddleware
- Interface for observing and intercepting LevitScope lifecycle events.
- Ls
- The global entry point for accessing the LevitScope system.
Extensions
-
LevitAsyncBuilderExtension
on Future<
T> Function() - Extensions for registering asynchronous builder functions.
-
LevitAsyncInstanceExtension
on Future<
T> - Extensions for registering asynchronous dependencies.
- LevitBuilderExtension on T Function()
- Extensions for registering builder functions.
- LevitInstanceExtension on T
- Extensions for registering instances directly into the active LevitScope.
- LevitScopeImplicitScopeExtension on LevitScope
- Extensions for executing code within a specific LevitScope.
- LevitScopeToBuilderExtension on T
- Extension to convert any object to a builder function.