forEachState method

bool forEachState(
  1. void func(
    1. StateX<StatefulWidget> state
    )
)
inherited

To externally 'process' through the State objects. Invokes func on each StateX possessed by this object.

Implementation

bool forEachState(void Function(StateX state) func) {
  bool each = true;
  final list = _stateXSet.toList(growable: false);
  for (final StateX state in list) {
    try {
      if (state.mounted && !state.deactivated) {
        func(state);
      }
    } catch (e, stack) {
      each = false;
      // Record the error
      state.recordException(e, stack);
    }
  }
  return each;
}