onDependencyRegister method

void onDependencyRegister(
  1. int scopeId,
  2. String scopeName,
  3. String key,
  4. LevitDependency info, {
  5. required String source,
  6. int? parentScopeId,
})

Called when a dependency is registered via LevitScope.put, LevitScope.lazyPut or their async variants.

  • scopeId: Unique identifier for the scope instance.
  • scopeName: The name of the scope where the dependency is registered.
  • key: The key under which the dependency is registered (type + optional tag).
  • info: Metadata about the registered dependency.
  • source: The method that triggered the event (e.g., 'put', 'lazyPut').
  • parentScopeId: The ID of the parent scope, or null if root.

Implementation

void onDependencyRegister(
    int scopeId, String scopeName, String key, LevitDependency info,
    {required String source, int? parentScopeId}) {}