next<State, Effect> function

  1. @experimental
(State?, List<Effect>) next<State, Effect>({
  1. State? state,
  2. List<Effect> effects = const [],
})

A helper function for constructing a Next result.

This function simplifies the process of returning the next state and side effects. Instead of writing return (null, const []);, you can use: return next();

  • state: The next state, or null to indicate no state change.
  • effects: A list of side effects to execute. Defaults to an empty list.

Implementation

@experimental
@pragma('vm:prefer-inline')
(State?, List<Effect>) next<State, Effect>({
  State? state,
  List<Effect> effects = const [],
}) =>
    (state, effects);