performAction method

void performAction(
  1. int id,
  2. SemanticsAction action,
  3. [Object? args]
)

Asks the SemanticsNode with the given id to perform the given action.

If the SemanticsNode has not indicated that it can perform the action, this function does nothing.

If the given action requires arguments they need to be passed in via the args parameter.

Implementation

void performAction(int id, SemanticsAction action, [ Object? args ]) {
  final SemanticsActionHandler? handler = _getSemanticsActionHandlerForId(id, action);
  if (handler != null) {
    handler(args);
    return;
  }

  // Default actions if no [handler] was provided.
  if (action == SemanticsAction.showOnScreen && _nodes[id]?._showOnScreen != null) {
    _nodes[id]!._showOnScreen!();
  }
}