Action class



Action([dynamic payload])
when call doAction,usually you need to pass some data the data (here called payload) you may use in process method


hashCode int
The hash code for this object. [...]
read-only, inherited
module String
read / write
payload ↔ dynamic
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


doChildAction(Action action) → void
in one action's process method, if you want start another action follow closely, you can call this method. otherwise, don't !
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
process(Map moduleStore) Future
@param moduleStore the copy of module store your action's module indicates you can use this action's payload data, deal with it or fetch api or something else when finished , you need return a Map that tell me which property was modified of the module store eg. // outside you have a module store like this: { 'name': 'reaction' }; // once you wanner rename 'reaction' to 'flutter-reaction' doAction(RenameAction('flutter-reaction')); // then in the class RenameAction's process method, code is like: Future process(Map moduleStore) async { bool renameOk = await fetch(someApi); if (renameOk) { // server said we rename succeed return {'name': this.payload} // this.payload's value is 'flutter-reaction' // then the module store's property name will be modified to 'flutter-reaction' // if your widget is inherits ModuleState class, it will fresh render with the new 'name' value which is 'flutter-reaction' } return {}; // server fail, so return a blank map to tell me nothing was modified }
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]