GlobalCycleDetectionMixin mixin
Enhanced mixin for global circular dependency detection, to be mixed into DI scopes or containers that want cross-scope protection.
Typical usage pattern:
class MySubscope with GlobalCycleDetectionMixin { ... }
final scope = MySubscope();
scope.setScopeId('user_profile');
scope.enableGlobalCycleDetection();
scope.withGlobalCycleDetection(UserService, null, () {
// ... resolve user service and friends, auto-detects global cycles
});
- Mixin applications
Properties
-
globalResolutionChain
→ List<
String> -
Access the current global dependency resolution chain for diagnostics.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isGlobalCycleDetectionEnabled → bool
-
Returns true if global cycle detection is currently enabled for this scope/container.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scopeId → String?
-
Get the scope's id, if configured.
no setter
Methods
-
disableGlobalCycleDetection(
) → void - Disable global cycle detection (no cycle checks will be performed globally).
-
enableGlobalCycleDetection(
) → void - Enable global cross-scope circular dependency detection.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setScopeId(
String scopeId) → void - Set the scope's unique identifier for global tracking (should be called at scope initialization).
-
toString(
) → String -
A string representation of this object.
inherited
-
withGlobalCycleDetection<
T> (Type dependencyType, String? named, T action()) → T -
Executes
actionwith global cycle detection fordependencyTypeandnamed. Throws CircularDependencyException if a cycle is detected.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited