reset static method
Disposes all registered modules.
This method disposes all registered modules and clears the internal modules map. After disposing, it will:
- Reset the module's state and injector
- Re-process its imports to ensure dependencies are properly linked
Example:
// In a test file
tearDown(() {
EasyDI.reset(); // Reset modules between tests
});
Implementation
@visibleForTesting
static void reset() {
for (final module in _modules.values) {
module.dispose();
}
_modules.clear();
}