Cubix<TState> constructor
Null safety
- TState initialState,
- [CubitWrapper<
TState> create(- TState initialState
Implementation
Cubix(TState initialState,
[CubitWrapper<TState> Function(TState initialState)? create])
: cubit = (create ?? CubitWrapper.new)(initialState) {
// forward protected event handlers
cubit.on(
change: (change) => onChange(Change(
currentState: change.currentState.state,
nextState: change.nextState.state)),
error: onError,
);
}