onSetState method

Future<SilentActionResult> onSetState(
  1. NodeSpec action,
  2. ActionContext context
)

Implementation

Future<SilentActionResult> onSetState(
    NodeSpec action, ActionContext context) async {
  final newState = Map<String, dynamic>.from(action.props["newState"] ?? {});
  try {
    BlocProvider.of<LocalBloc>(context.buildContext)
        .add(EmitState(SetStateState(newState)));
  } catch (e, stack) {
    log.severe("LocalBloc not found while emitting SetState.", e, stack);
  }
  return SilentActionResult(true, returnData: newState);
}