runFunction method

Future runFunction(
  1. VariablesAction action,
  2. BuildContext context,
  3. dynamic inputValue,
  4. int loop,
)

Implementation

Future<dynamic> runFunction(
  VariablesAction action,
  BuildContext context,
  dynamic inputValue,
  int loop,
) async {
  try {
    if (action is AssignVariableAction) {
      return assignVariable(
        action,
        context,
        inputValue,
        loop,
        null,
      );
    }
    throw Exception('No function found');
  } catch (e) {
    context.read<AppLogsCubit>().onNewLog(
          EditorLogEntity(
            id: _uuid.v1(),
            content: e.toString(),
            createdAt: DateTime.now(),
          ),
        );
  }
  return;
}