SupportsConstructorsMixin mixin base

A mixin that provides methods for working with constructors of dependencies, using generic types for type resolution.

Superclass constraints
Mixin applications

Properties

childrenContainer Option<DI>
Container for child DI instances.
getter/setter pairinherited
focusGroup Entity
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<DI>
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 groupEntity = const DefaultEntity(), bool traverse = true}) → T
inherited
children() Option<Iterable<DI>>
Retrieves an iterable of child DI instances.
inherited
get<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Option<Resolvable<T>>
Retrieves a dependency from the container. Retrieves a dependency from the container.
inherited
getAsync<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Option<Async<T>>
inherited
getAsyncUnsafe<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Future<T>
Retrieves an asynchronous dependency unsafely, returning a future of the instance or throwing an error if not found.
inherited
getDependency<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Option<Result<Dependency<T>>>
Retrieves the underlying Dependency object from the registry.
inherited
getFactory<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Option<Resolvable<T>>
Retrieves the factory dependency.
getFactorySyncOrNone<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Option<T>
Retrieves the lazily loaded factory dependency unsafely, returning the instance as an Option.
getFactoryUnsafe<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) FutureOr<T>
Retrieves the factory dependency unsafely, returning the instance directly or throwing an error if not found.
getLazy<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Option<Resolvable<Lazy<T>>>
Retrieves the lazily loaded dependency.
getLazySingleton<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Option<Resolvable<T>>
Retrieves the lazily loaded singleton dependency.
getLazySingletonSyncOrNone<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Option<T>
Retrieves the lazily loaded singleton dependency unsafely, returning the instance as an Option.
getLazySingletonUnsafe<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) FutureOr<T>
Retrieves the lazily loaded singleton dependency unsafely, returning the instance directly or throwing an error if not found or not a singleton.
getLazySyncOrNone<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Option<Lazy<T>>
Retrieves the lazily loaded dependency.
getLazyUnsafe<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) FutureOr<Lazy<T>>
Retrieves the lazily loaded singleton dependency unsafely, returning the instance directly or throwing an error if not found or not a singleton.
getSync<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Option<Sync<T>>
Retrieves a synchronous dependency.
inherited
getSyncOrNone<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Option<T>
Retrieves a synchronous dependency or None if not found or async.
inherited
getSyncUnsafe<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) → T
Retrieves a synchronous dependency.
inherited
getUnsafe<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) FutureOr<T>
Retrieves a dependency unsafely, returning the instance or a future of it, or throwing an error if not found.
inherited
isRegistered<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) bool
Retrieves a synchronous dependency unsafely, returning the instance directly or throwing an error if not found or async.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register<T extends Object>(FutureOr<T> value, {TOnRegisterCallback<T>? onRegister, TOnUnregisterCallback<T>? onUnregister, Entity groupEntity = const DefaultEntity(), bool enableUntilExactlyK = false}) Resolvable<T>
Registers a dependency with the container.
inherited
registerConstructor<T extends Object>(FutureOr<T> constructor(), {TOnRegisterCallback<Lazy<T>>? onRegister, TOnUnregisterCallback<Lazy<T>>? onUnregister, Entity groupEntity = const DefaultEntity()}) Resolvable<Lazy<T>>
Registers a lazy dependency.
registerDependency<T extends Object>({required Dependency<T> dependency, bool checkExisting = false}) Result<Dependency<T>>
Registers a Dependency object directly into the registry.
inherited
registerLazy<T extends Object>(LazyConstructor<T> constructor, {TOnRegisterCallback<Lazy<T>>? onRegister, TOnUnregisterCallback<Lazy<T>>? onUnregister, Entity groupEntity = const DefaultEntity()}) Resolvable<Lazy<T>>
Registers a lazy dependency.
removeDependency<T extends Object>({Entity groupEntity = const DefaultEntity()}) Option<Dependency<Object>>
Removes a dependency from the internal registry.
inherited
resetLazySingleton<T extends Object>({Entity groupEntity = const DefaultEntity()}) Resolvable<Unit>
Resets the singleton instance of a lazily loaded dependency.
resolveAll({Entity? groupEntity = const DefaultEntity()}) Resolvable<Unit>
Completes once all Async dependencies associated with groupEntity complete or any group if groupEntity is null.
inherited
toString() String
A string representation of this object.
inherited
unregister<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true, bool removeAll = true, bool triggerOnUnregisterCallbacks = true}) Resolvable<Option<T>>
Unregisters a dependency.
inherited
unregisterLazy<T extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true, bool removeAll = true, bool triggerOnUnregisterCallbacks = true}) Resolvable<Option<Object>>
Unregisters a lazily loaded dependency.
until<TSuper extends Object, TSub extends TSuper>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Resolvable<TSub>
Waits until a dependency of type TSuper or its subtype TSub is registered. TSuper should typically be the most general type expected.
inherited
untilFactory<TSuper extends Object, TSub extends TSuper>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Resolvable<TSub>
Waits until a dependency of type TSuper or its subtype TSub is registered. TSuper should typically be the most general type expected.
untilFactorySuper<TSuper extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Resolvable<TSuper>
Waits until a dependency of type TSuper is registered. TSuper should typically be the most general type expected.
untilLazy<TSuper extends Object, TSub extends TSuper>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Resolvable<Lazy<TSub>>
Waits until a dependency of type TSuper or its subtype TSub is registered. TSuper should typically be the most general type expected.
untilLazySingleton<TSuper extends Object, TSub extends TSuper>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Resolvable<TSub>
Waits until a dependency of type TSuper or its subtype TSub is registered. TSuper should typically be the most general type expected.
untilLazySingletonSuper<TSuper extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Resolvable<TSuper>
Waits until a dependency of type TSuper is registered. TSuper should typically be the most general type expected.
untilLazySuper<TSuper extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Resolvable<Lazy<TSuper>>
Waits until a dependency of type TSuper is registered. TSuper should typically be the most general type expected.
untilSuper<TSuper extends Object>({Entity groupEntity = const DefaultEntity(), bool traverse = true}) Resolvable<TSuper>
Waits until a dependency of type TSuper is registered. TSuper should typically be the most general type expected.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited