extendState method
Returns a StateExtensionBuilder that can be used to extend the state identified by
stateKey with additional metadata and filters.
Throws StateError if a state with stateKey has not already been defined.
Implementation
StateExtensionBuilder extendState(StateKey stateKey) {
var stateBuilder = _stateBuilders[stateKey];
return stateBuilder != null
? StateExtensionBuilder._(stateBuilder)
: throw StateError(
'State $stateKey has not been defined with this $runtimeType');
}