toIterable property

Iterable<State<T>> toIterable

Walks this subtree in depth-first order.

Implementation

Iterable<State<T>> get toIterable sync* {
  Iterable<State<T>> _toIterable(State<T> node) sync* {
    yield node;
    for (var child in node.substates) {
      yield* _toIterable(child);
    }
  }

  yield* _toIterable(this);
}