gestureHelper static method
void
gestureHelper(
{ - Widget? gesture,
- String? gestureType,
})
Implementation
static void gestureHelper({Widget? gesture, String? gestureType}) async {
if (gesture == null) {
tlLogger.w(
'Warning: Gesture is null in gestureHelper, type: ${gestureType ?? "<NONE>"}',
);
return;
}
final int hashCode = gesture.hashCode;
if (WidgetPath.containsKey(hashCode)) {
final WidgetPath? wp = WidgetPath.getPath(hashCode);
final BuildContext? context = wp!.context;
final String gestureTarget = getGestureTarget(wp);
final Map<String, dynamic> accessibility = checkForSemantics(wp);
tlLogger.t(
'${gestureType!.toUpperCase()}: Gesture widget, context hash: ${context.hashCode}, widget hash: $hashCode',
);
tlLogger.t('--> Path: ${wp.widgetPath()}, digest: ${wp.widgetDigest()}');
if (ConnectHelper.captureScreen) {
await PluginConnect.onTlGestureEvent(
gesture: gestureType,
id: wp.widgetPath(),
target: gestureTarget,
data: accessibility.isNotEmpty ? accessibility : null,
layoutParameters: TlBinder.layoutParametersForGestures,
);
}
} else {
tlLogger.t(
"ERROR: ${gesture.runtimeType.toString()} gesture not found for hashcode: $hashCode",
);
}
}