diff --git a/packages/pdfx/lib/src/viewer/pinch/pdf_view_pinch.dart b/packages/pdfx/lib/src/viewer/pinch/pdf_view_pinch.dart index 294ddc98..894712c8 100644 --- a/packages/pdfx/lib/src/viewer/pinch/pdf_view_pinch.dart +++ b/packages/pdfx/lib/src/viewer/pinch/pdf_view_pinch.dart @@ -26,6 +26,9 @@ class PdfViewPinch extends StatefulWidget { this.onPageChanged, this.onDocumentLoaded, this.onDocumentError, + this.onInteractionStart, + this.onInteractionUpdate, + this.onInteractionEnd, this.builders = const PdfViewPinchBuilders( options: DefaultBuilderOptions(), ), @@ -76,6 +79,15 @@ class PdfViewPinch extends StatefulWidget { /// Pdf widget page background decoration final BoxDecoration backgroundDecoration; + /// Called when the user starts a pan or scale gesture on the widget. + final GestureScaleStartCallback? onInteractionStart; + + /// Called when the user ends a pan or scale gesture on the widget. + final GestureScaleEndCallback? onInteractionEnd; + + /// Called when the user updates a pan or scale gesture on the widget. + final GestureScaleUpdateCallback? onInteractionUpdate; + /// Default page builder @override State createState() => _PdfViewPinchState(); @@ -564,6 +576,9 @@ class _PdfViewPinchState extends State _reLayout(viewSize); final docSize = _docSize ?? const Size(10, 10); // dummy size return InteractiveViewer( + onInteractionStart: widget.onInteractionStart, + onInteractionEnd: widget.onInteractionEnd, + onInteractionUpdate: widget.onInteractionUpdate, transformationController: _controller, scrollControls: InteractiveViewerScrollControls.scrollPans, constrained: false,