finalState method

void finalState(
  1. StateKey stateKey,
  2. void build(
    1. FinalStateBuilder builder
    )
)

Adds to the state tree a description of a final state, identified by stateKey. The behavior of the state is configured by the build callback.

A final state is a terminal state for a state tree. Once a final state has been entered, no further messsage processing or state transitions will occur.

A final state never has any child states, and is always a child of the root state.

Implementation

void finalState(StateKey stateKey, void Function(FinalStateBuilder builder) build) {
  var builder = _StateBuilder._(stateKey, null, null, true);
  build(builder);
  _addState(builder);
}