DI class final
Constructors
- DI()
Properties
-
children
→ List<
DI> -
Child containers.
no setterinherited
- completers ↔ DIBase?
-
A container storing Future completions.
getter/setter pairinherited
- dependencyCount ↔ int
-
Returns the total number of registered dependencies.
getter/setter pairinherited
-
focusGroup
↔ Entity<
Object> ? -
A key that identifies the current group in focus for dependency management.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
parents
→ Set<
DIBase> -
Parent containers.
finalinherited
- registry → DIRegistry
-
Internal registry that stores dependencies.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → T -
Retrieves a dependency of type
T
or subtypes ofT
registered under the specifiedgroupEntity
.inherited -
child(
{Entity< Object> ? groupEntity, bool validator(FutureOr<DI> )?, OnUnregisterCallback<FutureOr< ? onUnregister}) → DIDI> > -
inherited
-
completeRegistration<
T extends Object> (T value, Entity< Object> ? groupEntity) → void -
inherited
-
get<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> -
Retrieves a dependency of type
T
or subtypes ofT
registered under the specifiedgroupEntity
.inherited -
getAsync<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → Future<T> -
inherited
-
getAsyncT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → Future<Object> -
inherited
-
getChild(
{Entity< Object> ? groupEntity}) → DI -
inherited
-
getChildOrNull(
{Entity< Object> ? groupEntity}) → DI? -
inherited
-
getFactory<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> -
inherited
-
getFactoryAsync<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → Future<T> -
inherited
-
getFactoryAsyncT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → Future<Object> -
inherited
-
getFactoryOrNull<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> ? -
inherited
-
getFactoryOrNullT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<Object> ? -
inherited
-
getFactorySync<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → T -
inherited
-
getFactorySyncOrNull<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → T? -
inherited
-
getFactorySyncOrNullT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → Object? -
inherited
-
getFactorySyncT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → Object -
inherited
-
getFactoryT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<Object> -
inherited
-
getK(
Entity< Object> typeEntity, {Entity<Object> ? groupEntity, bool traverse = true}) → FutureOr<Object> -
Retrieves a dependency of the exact type
typeEntity
registered under the specifiedgroupEntity
.inherited -
getOrNull<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> ? -
Retrieves a dependency of type
T
or subtypes ofT
registered under the specifiedgroupEntity
.inherited -
getOrNullK(
Entity< Object> typeEntity, {Entity<Object> ? groupEntity, bool traverse = true}) → FutureOr<Object> ? -
Retrieves a dependency of the exact type
typeEntity
registered under the specifiedgroupEntity
.inherited -
getOrNullT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<Object> ? -
Retrieves a dependency of the exact runtime
type
registered under the specifiedgroupEntity
.inherited -
getServiceFactory<
T extends Service< (Object?> >{Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> -
inherited
-
getServiceFactoryAsync<
T extends Service< (Object?> >{Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → Future<T> -
inherited
-
getServiceFactoryAsyncT(
Type type, {Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → Future<Service< Object?> > -
inherited
-
getServiceFactoryOrNull<
T extends Service< (Object?> >{Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> ? -
inherited
-
getServiceFactoryOrNullT(
Type type, {Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<Service< ?Object?> > -
inherited
-
getServiceFactorySync<
T extends Service< (Object?> >{Object? params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → T -
inherited
-
getServiceFactorySyncOrNull<
T extends Service< (Object?> >{Object? params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → T? -
inherited
-
getServiceFactorySyncOrNullT(
Type type, {Object? params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → Service<Object?> ? -
inherited
-
getServiceFactorySyncT(
Type type, {Object? params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → Service<Object?> -
inherited
-
getServiceFactoryT(
Type type, {Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<Service< Object?> > -
inherited
-
getServiceFactoryWithParams<
T extends Service< (P> , P extends Object?>{required P params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> -
inherited
-
getServiceFactoryWithParamsAsync<
T extends Service< (P> , P extends Object?>{required P params, Entity< Object> ? groupEntity, bool traverse = true}) → Future<T> -
inherited
-
getServiceFactoryWithParamsOrNull<
T extends Service< (P> , P extends Object?>{required P params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> ? -
inherited
-
getServiceFactoryWithParamsSync<
T extends Service< (P> , P extends Object?>{required P params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → T -
inherited
-
getServiceFactoryWithParamsSyncOrNull<
T extends Service< (P> , P extends Object?>{required P params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → T? -
inherited
-
getServiceSingleton<
T extends Service< (Object?> >{Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> -
inherited
-
getServiceSingletonAsync<
T extends Service< (Object?> >{Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → Future<T> -
inherited
-
getServiceSingletonAsyncT(
Type type, {Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → Future<Service< Object?> > -
inherited
-
getServiceSingletonOrNull<
T extends Service< (Object?> >{Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> ? -
inherited
-
getServiceSingletonOrNullT(
Type type, {Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<Service< ?Object?> > -
inherited
-
getServiceSingletonSync<
T extends Service< (Object?> >{Object? params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → T -
inherited
-
getServiceSingletonSyncOrNull<
T extends Service< (Object?> >{Object? params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → T? -
inherited
-
getServiceSingletonSyncOrNullT(
Type type, {Object? params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → Service<Object?> ? -
inherited
-
getServiceSingletonSyncT(
Type type, {Object? params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → Service<Object?> -
inherited
-
getServiceSingletonT(
Type type, {Object? params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<Service< Object?> > -
inherited
-
getServiceSingletonWithParams<
T extends Service< (P> , P extends Object?>{required P params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> -
inherited
-
getServiceSingletonWithParamsAsync<
T extends Service< (P> , P extends Object?>{required P params, Entity< Object> ? groupEntity, bool traverse = true}) → Future<T> -
inherited
-
getServiceSingletonWithParamsOrNull<
T extends Service< (P> , P extends Object?>{required P params, Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> ? -
inherited
-
getServiceSingletonWithParamsSync<
T extends Service< (P> , P extends Object?>{required P params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → T -
inherited
-
getServiceSingletonWithParamsSyncOrNull<
T extends Service< (P> , P extends Object?>{required P params, Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → T? -
inherited
-
getSingleton<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> -
inherited
-
getSingletonAsync<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → Future<T> -
inherited
-
getSingletonAsyncT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → Future<Object> -
inherited
-
getSingletonOrNull<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> ? -
inherited
-
getSingletonOrNullT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<Object> ? -
inherited
-
getSingletonSync<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → T -
inherited
-
getSingletonSyncOrNull<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → T? -
inherited
-
getSingletonSyncOrNullT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → Object? -
inherited
-
getSingletonSyncT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → Object -
inherited
-
getSingletonT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<Object> -
inherited
-
getSync<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → T -
inherited
-
getSyncOrNull<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → T? -
inherited
-
getSyncOrNullT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true, bool throwIfAsync = false}) → Object? -
inherited
-
getSyncT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → Object -
inherited
-
getT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<Object> -
Retrieves a dependency of the exact runtime
type
registered under the specifiedgroupEntity
.inherited -
isRegistered<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → bool -
Checks whether dependency of type
T
or subtype ofT
is registered.inherited -
isRegisteredK(
Entity< Object> typeEntity, {Entity<Object> ? groupEntity, bool traverse = true}) → bool -
inherited
-
isRegisteredT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → bool -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register<
T extends Object> (FutureOr< T> value, {Entity<Object> ? groupEntity, DependencyValidator<FutureOr< ? validator, OnUnregisterCallback<T> >FutureOr< ? onUnregister}) → FutureOr<T> >T> -
Register a dependency
value
of typeT
under the specifiedgroupEntity
in theregistry
.inherited -
registerChild(
{Entity< Object> ? groupEntity, bool validator(FutureOr<DI> )?, OnUnregisterCallback<FutureOr< ? onUnregister}) → voidDI> > -
inherited
-
registerLazy<
T extends Object> (TConstructor< T> constructor, {Entity<Object> ? groupEntity, bool validator(FutureOr<T> instance)?, FutureOr<void> onUnregister(FutureOr<T> instance)?}) → Lazy<T> -
inherited
-
registerLazyService<
T extends Service< (Object?> >TConstructor< T> constructor, {Entity<Object> ? groupEntity, bool validator(FutureOr<T> instance)?, FutureOr<void> onUnregister(FutureOr<T> instance)?}) → void -
inherited
-
registerService<
T extends Service< (Object?> >FutureOr< T> service, {Object? params, Entity<Object> ? groupEntity, bool validator(FutureOr<T> instance)?, FutureOr<void> onUnregister(FutureOr<T> instance)?}) → FutureOr<T> -
inherited
-
resetSingleton<
T extends Object> ({Entity< Object> ? groupEntity}) → void -
inherited
-
resetSingletonT(
Type type, {Entity< Object> ? groupEntity}) → void -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unregister<
T extends Object> ({Entity< Object> ? groupEntity, bool skipOnUnregisterCallback = false}) → FutureOr<Object> -
Unregisters the dependency of type
T
associated with the specifiedgroupEntity
from theregistry
, if it exists.inherited -
unregisterAll(
{OnUnregisterCallback< Dependency< ? onBeforeUnregister, OnUnregisterCallback<Object> >Dependency< ? onAfterUnregister}) → FutureOr<Object> >List< Dependency< >Object> > -
Unregisters all dependencies in the reverse order they were registered.
inherited
-
unregisterChild(
{Entity< Object> ? groupEntity, bool skipOnUnregisterCallback = false}) → FutureOr<Object> -
inherited
-
unregisterK(
Entity< Object> typeEntity, {Entity<Object> ? groupEntity, bool skipOnUnregisterCallback = false}) → FutureOr<Object> -
inherited
-
unregisterT(
Type type, {Entity< Object> ? groupEntity, bool skipOnUnregisterCallback = false}) → FutureOr<Object> -
inherited
-
until<
T extends Object> ({Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<T> -
Retrieves a dependency of type
T
or subtypes ofT
registered under the specifiedgroupEntity
.inherited -
untilK(
Entity< Object> typeEntity, {Entity<Object> ? groupEntity, bool traverse = true}) → FutureOr<Object> -
inherited
-
untilT(
Type type, {Entity< Object> ? groupEntity, bool traverse = true}) → FutureOr<Object> -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- app → DI
-
A predefined container recommended for application-wide dependencies.
This container serves as the parent for other containers.
final
- dev → DI
-
A predefined container recommended for objects intended for development
environments. This container is a child of app.
no setter
- global → DI
-
A predefined container recommended for global dependencies. This
container is a child of app.
no setter
- prod → DI
-
A predefined container recommended for objects intended for production
environments. This container is a child of app.
no setter
- session → DI
-
A predefined container recommended for session-specific dependencies.
This container is a child of global.
no setter
- test → DI
-
A predefined container recommended for objects intended for testing
environments. This container is a child of app.
no setter
- theme → DI
-
A predefined container recommended for theme-related objects.
This container is a child of app.
no setter
- user → DI
-
A predefined container recommended for user-specific dependencies.
This container is a child of session.
no setter