Walkable<E>.from constructor
Creates a walkable from a map of source nodes to target nodes.
The resulting walkable is lazy, and is generally inefficient for
operations outside of iterating edges
. This is a convenience method for
creating a walkable from a collection of edges, i.e. in a test case.
Example
final walkable = Walkable.from({
'a': ['b'],
'b': ['c'],
'c': ['d'],
});
print(walkable.edges); // {a -> b, b -> c, c -> d}
Implementation
const factory Walkable.from(
Map<E, Iterable<E>> edges,
) = _EdgesWalkable<E>;