executeAction method

Future<Object?>? executeAction(
  1. ActionFlow? actionFlow, {
  2. ScopeContext? scopeContext,
  3. String? triggerType,
})

Executes an action flow with optional trigger context

Implementation

Future<Object?>? executeAction(
  ActionFlow? actionFlow, {
  ScopeContext? scopeContext,
  String? triggerType,
}) {
  if (actionFlow == null) return null;

  // Create observability context with trigger type if enabled
  ObservabilityContext? observabilityContextWithTrigger;
  if (DigiaUIManager().isInspectorEnabled &&
      (currentEntityId != null || widgetHierarchy.isNotEmpty)) {
    observabilityContextWithTrigger = ObservabilityContext(
      widgetHierarchy: widgetHierarchy,
      currentEntityId: currentEntityId,
      triggerType: triggerType,
    );
  }

  return DefaultActionExecutor.of(buildContext).execute(
    buildContext,
    actionFlow,
    _chainExprContext(scopeContext),
    id: IdHelper.randomId(),
    observabilityContext: observabilityContextWithTrigger,
  );
}