DependencyGraphController class

Controller that wraps DependencyGraph for use by the observer and UI widgets.

Provides convenience methods for adding/removing providers, querying dependencies, detecting circular dependencies, and serializing/deserializing the graph.

Constructors

DependencyGraphController()

Properties

graph DependencyGraph
The underlying dependency graph (read-only from outside).
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addDependency(String from, String to) → void
Records that from depends on to.
addProvider(String name, String type) → void
Adds a provider node to the graph.
clear() → void
Removes all nodes and edges from the graph.
detectCircularDependencies() List<String>
Runs full-cycle detection on the entire graph. Returns human-readable descriptions of all cycles found.
getDependencies(String providerName) List<String>
Returns providers that providerName directly depends on.
getDependents(String providerName) List<String>
Returns providers that directly depend on providerName.
hasCircularDependency(String startNode) bool
Returns true if startNode is part of a circular dependency.
importFromJson(List<Map<String, dynamic>> json) → void
Deserializes and merges a graph from toJson output. Clears the current graph before importing.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeProvider(String name) → void
Removes a provider and all its edges from the graph.
toJson() List<Map<String, dynamic>>
Serializes the graph to a list of JSON-compatible maps.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited