scan method

Future<void> scan([
  1. List<String>? packagePatterns
])

Scans for components and registers them automatically

This method will call the generated registration code instead of using mirrors

Implementation

Future<void> scan([List<String>? packagePatterns]) async {
  if (_initialized) {
    throw ContainerInitializationException('Container already initialized');
  }

  try {
    // The generated extension should override this method or provide additional setup
    _initialized = true;
  } catch (e) {
    throw ContainerInitializationException('Failed to scan components: $e');
  }
}