handleDoubleTap method

  1. @protected
void handleDoubleTap(
  1. BuildContext context,
  2. PointerDownEvent details,
  3. ZoomConfigs configs
)

Handles a confirmed double-tap gesture and performs a zoom action.

Converts the global tap position to local coordinates and zooms in using the configuration provided in configs.

Implementation

@protected
void handleDoubleTap(
  BuildContext context,
  PointerDownEvent details,
  ZoomConfigs configs,
) {
  if (configs.enableDoubleTapZoom && _lastTapDownOffset != null) {
    final renderBox = context.findRenderObject() as RenderBox;
    final localTap = renderBox.globalToLocal(_lastTapDownOffset!);
    interactiveViewer.currentState?.quickZoomTo(
      localTap,
      configs.doubleTapZoomFactor,
      curve: configs.doubleTapZoomCurve,
      duration: configs.doubleTapZoomDuration,
    );
  }
}