on method Null safety

void on(
  1. {dynamic error(
    1. Object error,
    2. StackTrace stackTrace
    )?,
  2. dynamic change(
    1. Change<CubixState<TState>> change
    )?}
)

Implementation

void on(
    {Function(Object error, StackTrace stackTrace)? error,
    Function(Change<CubixState<TState>> change)? change}) {
  _onChange = change;
  _onError = error;
}