mutateState method

  1. @mustCallSuper
  2. @protected
void mutateState(
  1. T newState
)

This method changes the _state and adds events to onStateChanged

Implementation

@mustCallSuper
@protected
void mutateState(T newState) {
  _state = newState;
  if (!isDisposed) {
    _onStateChangedController.add(_state);
    _onStateChangedControllerWithLatest.add(state);
  }
}