importFromJson method
Deserializes and merges a graph from toJson output. Clears the current graph before importing.
Implementation
void importFromJson(List<Map<String, dynamic>> json) {
_graph.clear();
final imported = DependencyGraph.fromJson(json);
for (final entry in imported.nodes.entries) {
_graph.addProvider(entry.key, entry.value.providerType);
for (final dep in entry.value.dependsOn) {
_graph.addDependency(entry.key, dep);
}
}
}