endigo / flutter_pdfview

PDF view for Flutter
https://pub.dev/packages/flutter_pdfview
MIT License
263 stars 218 forks source link

[IOS] swipe not working if the PDFView in a scrollable widget #265

Open shehab0717 opened 1 year ago

shehab0717 commented 1 year ago

I have a SingleChildScrollView wrapping a Column one of its children is the PDFView, so when I try to swipe the pd (vertically or horizontally), it doesn't work on IOS device but it works fine on Android

RitliRoland commented 11 months ago

Same issue in android 14.0. There is the emulator properties (but I tried on a live tablet, same issue): Properties avd.ini.displayname 13.5 Freeform API 34 avd.ini.encoding UTF-8 AvdId 13.5_Freeform_API_34 disk.dataPartition.size 6442450944 display.settings.xml freeform fastboot.chosenSnapshotFile fastboot.forceChosenSnapshotBoot no fastboot.forceColdBoot no fastboot.forceFastBoot yes hw.accelerometer yes hw.arc false hw.audioInput yes hw.battery yes hw.camera.back virtualscene hw.camera.front emulated hw.cpu.ncore 4 hw.device.hash2 MD5:c1e16fb26f89e9e2eecdc181aebcd1d6 hw.device.manufacturer Generic hw.device.name 13.5in Freeform hw.dPad no hw.gps yes hw.gpu.enabled yes hw.gpu.mode auto hw.initialOrientation landscape hw.keyboard yes hw.lcd.density 240 hw.lcd.height 1440 hw.lcd.width 2560 hw.mainKeys no hw.ramSize 1536 hw.sdCard yes hw.sensors.orientation yes hw.sensors.proximity yes hw.trackBall no image.androidVersion.api 34 image.sysdir.1 system-images\android-34\google_apis\x86_64\ PlayStore.enabled false runtime.network.latency none runtime.network.speed full showDeviceFrame no skin.dynamic yes skin.path.backup _no_skin tag.display Google APIs tag.id google_apis vm.heapSize 96

There is a simple example. I can't scroll the pdf, but I can scroll the containers. return Scaffold( appBar: Header(), body: SingleChildScrollView( child: Column( children: [ SizedBox( height: 600, child: PDFView( filePath: '/data/user/0/com.example.electricnet/app_flutter/example.pdf', ), ), SizedBox(height: 50), SizedBox( height: 400, child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container(height: 200, color: Colors.yellow), Container(height: 200, color: Colors.red), Container(height: 200, color: Colors.blue), ], ), ), ), ], ), ), );

Siddharth2212 commented 7 months ago

Add gestureRecognizers option in PDFView like this: PDFView( gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[ new Factory<OneSequenceGestureRecognizer>( () => new EagerGestureRecognizer(), ), ].toSet(), autoSpacing: false, fitPolicy: FitPolicy.WIDTH, filePath: remotePDFpath, enableSwipe: true, swipeHorizontal: true, defaultPage: 0, pageFling: true, fitEachPage: true, onPageChanged: ((page, total) { // currentIndexNotifier.value = i; }), onViewCreated: (PDFViewController pdfViewController) { pdfController.complete(pdfViewController); }, )