Dependon class abstract

Dependency injection management.

final Dependon di = Dependon.instance;
di.singleton<UserRepository>(() => UserRepositoryImpl(get()));

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

clear() → void
Removes all the registrations in the dependency injection map.
controller<T extends Object>(T builder(), {String? tag}) → void
Creates a controller instance which represents a singleton that is lazy initialized and can be unset.
enableLogging([bool enabled = false]) → void
Dependency injection logs.
factory<T extends Object>(T builder()) → void
Registers a new creation's instruction for a factory.
get<T extends Object>({String? tag}) → T
Returns the requested object by type.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove<T extends Object>({String? tag}) → void
Removes the registration of the provided type.
singleton<T extends Object>(T builder(), {String? tag, bool lazy = true}) → void
Creates a new singleton registration. Be careful: when declaring non-lazy singletons your dependencies MUST has been declared BEFORE the current one.
toString() String
A string representation of this object.
inherited
unset<T extends Object>({String? tag}) → void
Deletes the current existing instance of the provided object but keeps the creation instruction.

Operators

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

Static Properties

instance Dependon
Retrieves the existing instance of DependencyInjection.
no setter