setProp method

  1. @protected
void setProp(
  1. Object? key,
  2. Object? value
)

Sets a property in the store. This can be used to save global values, but scoped to the store. For example, you could save timers, streams or futures used by actions.

setProp("timer", Timer(Duration(seconds: 1), () => print("tick")));
var timer = prop<Timer>("timer");
timer.cancel();

See also: prop and env.

Implementation

@protected
void setProp(Object? key, Object? value) => store.setProp(key, value);