EasyDI class abstract

A singleton class responsible for initializing and managing modules.

This class handles the registration, initialization and dependency injection between modules. It maintains a map of module types to module instances and processes module imports to establish dependencies.

Constructors

EasyDI.new()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

modules UnmodifiableMapView<Type, EasyModule>
no setter

Static Methods

disposeModule<T extends EasyModule>() Future<void>
Disposes a module and reloads all modules that depend on it.
get<T extends Object>(BuildContext context, {bool listen = false}) → T
Gets a dependency of type T from the closest EasyModule in the widget tree.
getModule<T extends EasyModule>() → T?
Gets a module instance of type T if it exists.
initModules(List<EasyModule> modules) Future<void>
Initializes a list of modules in a single operation.
initRegisteredModules() Future<void>
Initializes all registered modules and processes their imports.
registerModules(List<EasyModule> modules) → void
Registers multiple modules to the initializer.
replace<T extends Object>(T instance, {String? key}) → void
Replaces an instance in all modules that have registered it.
replaceFromModule<TModule extends EasyModule, TInstance extends Object>(TInstance instance, {String? key}) → void
Replaces an instance in a specific module.
reset() → void
Disposes all registered modules.