handleDoubleTap method
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,
);
}
}