stateActions property

Map<Object, Function> get stateActions

The handlers this state runs for the actions sent to it.

A String key names an action sent with stateAction, StateActions.call or NyController.updatePageState; its handler takes the action's data as one parameter, or nothing. A Symbol key names a typed action sent by a bodiless method on a PageStateActions subclass; its handler takes the method's own parameters, so it is usually the method itself, as a tear-off:

@override
Map<Object, Function> get stateActions => {
  "shake_the_logo": () { ... },
  "set_stars": (int stars) { ... },
  #shakeTheLogo: shakeTheLogo,
};

Use symbol literals (#shakeTheLogo) for typed actions: they survive flutter build --obfuscate, a Symbol("...") built from a string does not.

Implementation

Map<Object, Function> get stateActions => _stateActions;