runFunction method

Future runFunction(
  1. ConditionalAction action,
  2. BuildContext context,
  3. dynamic inputValue,
  4. int loop, {
  5. String? jsonKey,
})

Implementation

Future<dynamic> runFunction(
  ConditionalAction action,
  BuildContext context,
  dynamic inputValue,
  int loop, {
  String? jsonKey,
}) async {
  try {
    if (context.mounted) {
      await action.condition.getValue(
        context,
        () async => await _runTrueFunctions(
          action,
          context,
          inputValue,
          loop,
        ),
        () async => await _runFalseFunctions(
          action,
          context,
          inputValue,
          loop,
        ),
        loop,
        null,
      );
    }
  } catch (e) {
    if (context.mounted) {
      context.logsCubit.onNewLog(
        EditorLogEntity(
          id: _uuid.v1(),
          content: e.toString(),
          createdAt: DateTime.now(),
        ),
      );
    }
  }
  return;
}