allStates property Null safety

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.


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