getFunction method
ActionFunction?
getFunction(
- BuildContext context,
- dynamic actionSpec,
- Map state,
- Map? evaluatorContext,
Returns a ActionFunction that executes an Action based on it's actionSpec
.
Implementation
ActionFunction? getFunction(BuildContext context, dynamic actionSpec,
Map state, Map? evaluatorContext) {
if (actionSpec == null) return null;
if (EditorBloc.editMode) return () {};
if (actionSpec is ActionFunction) return actionSpec;
final nodeSpec =
actionSpec is NodeSpec ? actionSpec : NodeSpec.fromMap(actionSpec);
return () {
run(context, nodeSpec, state, null, evaluatorContext);
};
}