Hi Hamdi Boyaci,
In SfPdfViewer, we have used the gestures to detect tapping
and zooming, so when using the gestures in the main.dart , it does not trigger
those gestures first instead, which triggers the gestures inside the
SfPdfViewer widget. We recommend using the RawGestureDetector over the
SfPdfViewer widget. The following code example also explains the same.
Code Snippet:
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Syncfusion Flutter
PDF Viewer'),
),
body: RawGestureDetector(
gestures: {
GestureRecognizer:
GestureRecognizerFactoryWithHandlers<GestureRecognizer>(
() => GestureRecognizer(),
//constructor
(GestureRecognizer instance) {
//initializer
instance.onTap = () =>
print('Tapped');
},
)
},
child: SfPdfViewer.network(
'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf',
key: _pdfViewerKey,
),
),
);
}
}
class GestureRecognizer
extends TapGestureRecognizer {
@override
void rejectGesture(int pointer) {
acceptGesture(pointer);
}
}
|
Regards,
Deepika R