handleDoubleTap method

void handleDoubleTap(
  1. Offset position
)

Implementation

void handleDoubleTap(Offset position) {
  final Offset localPosition = globalToLocal(position);
  if (onPointDoubleTap != null && _interactiveSegment != null) {
    final int pointIndex =
        dataPointIndex(localPosition, _interactiveSegment!);
    final int segPointIndex =
        segmentPointIndex(localPosition, _interactiveSegment!);
    final ChartPointDetails pointDetails = ChartPointDetails(
      index,
      viewportIndex(segPointIndex),
      chartPoints,
      pointIndex,
    );
    onPointDoubleTap!(pointDetails);
  }

  if (parent != null && _interactiveSegment != null) {
    final bool hasSelection = _selectionEnabled &&
        parent!.selectionGesture == ActivationMode.doubleTap;
    final bool hasTooltip = _tooltipEnabled &&
        parent!.tooltipBehavior!.activationMode == ActivationMode.doubleTap;
    _handleCurrentInteraction(hasSelection, hasTooltip, localPosition);
  }
}