gestureHelper static method

void gestureHelper({
  1. Widget? gesture,
  2. 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.v(
        '${gestureType!.toUpperCase()}: Gesture widget, context hash: ${context.hashCode}, widget hash: $hashCode');
    tlLogger.v('--> Path: ${wp.widgetPath()}, digest: ${wp.widgetDigest()}');

    await PluginTealeaf.onTlGestureEvent(
        gesture: gestureType,
        id: wp.widgetPath(),
        target: gestureTarget,
        data: accessibility.isNotEmpty ? accessibility : null,
        layoutParameters: TlBinder.layoutParametersForGestures);
  } else {
    tlLogger.v(
        "ERROR: ${gesture.runtimeType.toString()} gesture not found for hashcode: $hashCode");
  }
}