setState abstract method
Future<T?>
setState(
- Object? mutator(
- T s
- SideEffects<
T> ? sideEffects, - StateInterceptor<
T> ? stateInterceptor, - bool shouldOverrideDefaultSideEffects(
- SnapState<
T> snap
- SnapState<
- int debounceDelay = 0,
- int throttleDelay = 0,
Mutate the state of the model and notify observers.
- Required parameters:
- The mutation function. It takes the current state fo the model. The function can have any type of return including Future and Stream.
- Optional parameters:
- sideEffects: Used to handle side effects resulting from calling this method. It takes SideEffects object. Notice that SideEffects.initState and SideEffects.dispose are never called here.
- shouldOverrideDefaultSideEffects: used to decide when to override the default side effects defined in RM.inject and other equivalent methods.
- debounceDelay: time in milliseconds to debounce the execution of setState.
- throttleDelay: time in milliseconds to throttle the execution of setState.
Implementation
Future<T?> setState(
Object? Function(T s) mutator, {
SideEffects<T>? sideEffects,
StateInterceptor<T>? stateInterceptor,
bool Function(SnapState<T> snap)? shouldOverrideDefaultSideEffects,
int debounceDelay = 0,
int throttleDelay = 0,
});