Dependencies class
A class to manage dependencies within the application. This class provides methods to register, find, delete, and manage dependencies in a centralized manner. It leverages GetX for state management and dependency injection. This allows for lazy loading, lifecycle management, and the ability to work with isolated instances when needed.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call<
S> () → S -
Finds and retrieves a dependency of type
S
. -
delete<
S> ({String? tag, bool force = false}) → bool -
Deletes a registered dependency.
tag
is an optional identifier, andforce
determines whether to forcibly delete. -
deleteAll(
{bool force = false}) → void -
Deletes all registered dependencies in the application.
force
determines whether to force the deletion. -
find<
S> ({String? tag}) → S -
Finds and retrieves a dependency of type
S
.tag
is an optional identifier to retrieve a tagged instance. -
isPrepared<
S> ({String? tag}) → bool - Checks if a dependency is prepared.
-
isRegistered<
S> ({String? tag}) → bool - Checks if a dependency is registered.
-
lazyPut<
S> (InstanceBuilderCallback< S> builder, {String? tag, bool fenix = false}) → void -
Registers a lazy singleton dependency.
The
fenix
flag determines whether the dependency should be reconstructed when disposed. -
lazyReplace<
P> (InstanceBuilderCallback< P> builder, {String? tag, bool? fenix}) → void - Registers a lazy singleton dependency, replacing any existing dependency. This allows for automatic recreation of the dependency if disposed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put<
S> (S dependency, {String? tag, bool permanent = false, InstanceBuilderCallback< S> ? builder}) → S -
Registers a dependency of type
S
directly. It will be used as a singleton or as a permanent instance. -
reload<
S> ({String? tag, String? key, bool force = false}) → void -
Reloads a specific dependency of type
S
. Optionally,tag
andkey
can be provided to identify the dependency. -
reloadAll(
{bool force = false}) → void -
Reloads all registered dependencies in the application.
force
determines whether to force the reload. -
replace<
P> (P child, {String? tag}) → void -
Replaces a registered dependency with a new one.
P
is the type of the dependency being replaced, andchild
is the new instance. -
spawn<
S> (InstanceBuilderCallback< S> builder, {String? tag, bool permanent = true}) → void -
Creates and manages a background isolate dependency.
The
permanent
flag determines whether the instance will persist permanently. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited