reset static method

  1. @visibleForTesting
void reset()

Disposes all registered modules.

This method disposes all registered modules and clears the internal modules map. After disposing, it will:

  1. Reset the module's state and injector
  2. 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();
}