just_di 1.0.0
just_di: ^1.0.0 copied to clipboard
Lightweight, framework-agnostic dependency injection for Dart with scoped containers.
1.0.0 #
Initial stable release.
Added #
DiContainer— core dependency injection container withregisterSingleton,registerLazySingleton, andregisterFactory.DiScope— child container created viaDiContainer.createScope()for request, feature, or test isolation; inherits parent registrations via parent-chain resolution.JustDi— global static facade backed by a sharedDiContainerfor app-level service registration.Resolverinterface — read-only contract exposingget<T>,getOrNull<T>, andisRegistered<T>.- Named instance support via the optional
instanceNameparameter on all registration and resolution methods. overrideflag on all registration methods to allow explicit replacement of an existing registration.- Optional
InstanceDisposer<T>callback on singleton and lazy-singleton registrations, called automatically onunregister,reset, andclose. unregister<T>— removes a single registration with optional disposal.reset— removes all registrations from a container with optional disposal (in reverse registration order).close— disposes and permanently seals a container or scope.CircularDependencyException,DuplicateRegistrationException, andServiceNotFoundExceptionerror types.