setState method

  1. @Deprecated('setState is deprecated. Use update((state) => newState) instead for a safer, reactive state update.')
void setState(
  1. T newState, {
  2. JIntent<JState>? origin,
})
inherited

Sets a new state of type T if different from the current state.

If the new state is equal to the current state, no update is performed.

Implementation

@Deprecated(
  'setState is deprecated. Use update((state) => newState) instead for a safer, reactive state update.',
)
void setState(T newState, {JIntent? origin}) {
  update((_) => newState, origin: origin);
}