getChildren method
Implementation
List<N> getChildren(String id) {
final childEdges = edges[id];
if (childEdges == null) {
return <N>[]; // Explicitly return empty List<Node<N>>
}
return childEdges.values
.map((edge) => edge.to as N)
.toList(); // Ensure type consistency
}