finalDataState<D> method
void
finalDataState<D>(
- StateKey stateKey,
- InitialData<
D> initialData, - void build(
- EnterStateBuilder<
D> builder
- EnterStateBuilder<
- StateKey? parent,
- StateDataCodec? codec,
Adds to the state tree a description of a final data state, identified by stateKey and
carrying a value of type D. 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 finalDataState<D>(
StateKey stateKey,
InitialData<D> initialData,
void Function(EnterStateBuilder<D> builder) build, {
StateKey? parent,
StateDataCodec? codec,
}) {
var builder = StateBuilder<D>._(
stateKey,
initialData,
_log,
parent,
null,
isFinal: true,
codec: codec,
);
build(builder);
_addState(builder);
}