set<T> static method

T set<T>(
  1. BuildContext context, [
  2. dynamic call(
    1. T
    )?
])

Provides a shortcut for updating state of type T. This update can be mutable or immutable depending on if the setter call method returns the same type as T.

This calls the underlying ReactiveController.setState method to update the state.

Implementation

static T set<T>(BuildContext context, [dynamic Function(T)? call]) {
  final value = RS.getReactive<T>(context);
  value.setState(call);
  return value.state;
}