handleLongPressStart method

void handleLongPressStart(
  1. LongPressStartDetails details
)

Implementation

void handleLongPressStart(LongPressStartDetails details) {
  _canInvokePointerUp = false;
  final Offset localPosition = globalToLocal(details.globalPosition);
  if (onPointLongPress != null && _interactiveSegment != null) {
    final int pointIndex =
        dataPointIndex(localPosition, _interactiveSegment!);
    final int segPointIndex =
        segmentPointIndex(localPosition, _interactiveSegment!);
    final ChartPointDetails pointDetails = ChartPointDetails(
      index,
      viewportIndex(segPointIndex),
      chartPoints,
      pointIndex,
    );
    onPointLongPress!(pointDetails);
  }

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