FinalDataState<D> constructor
FinalDataState<D> (
- DataStateKey<
D> key, - InitialData<
D> initialData, { - TransitionHandler? onEnter,
- StateDataCodec<
D> ? codec,
Constructs a final data state, identified by key.
When the data state is entered, initialData will be used to determine
the initial value for the associated state data.
The behavior of the state when it is entered can be customized by
providing an onEnter function.
Implementation
factory FinalDataState(
DataStateKey<D> key,
InitialData<D> initialData, {
TransitionHandler? onEnter,
StateDataCodec<D>? codec,
}) =>
FinalDataState._((parent) {
return LeafNodeInfo(
key,
(_) => DelegatingDataTreeState<D>(initialData.call, onEnter: onEnter),
parent: parent,
isFinalState: true,
dataCodec: codec,
);
});