allStates property

Iterable<State<StatefulWidget>> allStates

All states currently in the widget tree (lazy pre-order traversal).

The returned iterable is lazy. It does not walk the entire widget tree immediately, but rather a chunk at a time as the iteration progresses using Iterator.moveNext.

Implementation

Iterable<State> get allStates {
  TestAsyncUtils.guardSync();
  return allElements
         .whereType<StatefulElement>()
         .map<State>((StatefulElement element) => element.state);
}