triggerElementTap function
Triggers a tap on a Flutter element previously reported to the native
SDK. Returns true if the matching SemanticsNode was found and the
tap action was dispatched.
Visible for testing so the bridge contract can be exercised without driving the full native plugin.
Implementation
@visibleForTesting
bool triggerElementTap(String identifier) {
final nodeId = _semanticNodeByIdentifier[identifier];
if (nodeId == null) {
AmplitudeLogger.warn(
'triggerElementTap: no Flutter element registered for identifier "$identifier"',
);
return false;
}
final semanticsOwner = _viewPipelineOwner?.semanticsOwner;
if (semanticsOwner == null) {
AmplitudeLogger.warn(
'triggerElementTap: SemanticsOwner is not available for identifier "$identifier"',
);
return false;
}
semanticsOwner.performAction(nodeId, SemanticsAction.tap);
return true;
}