cherrypick library

Classes

Binding<T>
BindingResolver<T>
Abstract interface for dependency resolvers used by Binding. Defines how to resolve instances of type T.
CherryPick
Static facade for managing dependency graph, root scope, subscopes, logger, and global settings in the CherryPick DI container.
CherryPickObserver
An abstract Observer for CherryPick DI container events.
CycleDetector
Circular dependency detector for CherryPick DI containers.
Disposable
An interface for resources that require explicit cleanup, used by the CherryPick dependency injection container.
GlobalCycleDetector
GlobalCycleDetector detects and prevents circular dependencies across an entire DI scope hierarchy.
InstanceResolver<T>
Concrete resolver for direct instance (T or Future<T>). No provider is called.
Module
Represents a DI module—a reusable group of dependency bindings.
PrintCherryPickObserver
Diagnostic/Debug observer that prints all events
ProviderResolver<T>
Resolver for provider functions (sync/async/factory), with optional singleton caching. Used for Binding.toProvide, Binding.toProvideWithParams, Binding.singleton.
Scope
Represents a DI scope (container) for modules, subscopes, and dependency resolution (sync/async) in CherryPick.
SilentCherryPickObserver
Silent observer: ignores all events

Mixins

CycleDetectionMixin
Mixin for adding circular dependency detection support to custom DI containers/classes.
GlobalCycleDetectionMixin
Enhanced mixin for global circular dependency detection, to be mixed into DI scopes or containers that want cross-scope protection.

Typedefs

Instance<T> = FutureOr<T>
Represents a direct instance or an async instance (T or Future<T>). Used for both direct and async bindings.
Provider<T> = FutureOr<T> Function()
Provider function type for synchronous or asynchronous, parameterless creation of T. Can return T or Future<T>.
ProviderWithParams<T> = FutureOr<T> Function(dynamic)
Provider function type that accepts a dynamic parameter, for factory/parametrized injection. Returns T or Future<T>.

Exceptions / Errors

CircularDependencyException
Exception thrown when a circular dependency is detected during dependency resolution.