packages.flutter icon indicating copy to clipboard operation
packages.flutter copied to clipboard

On TabBarView, PdfViewPinch disappear when click back on his tab

Open Paroca72 opened this issue 2 years ago • 3 comments

Hello,

Using PdfViewPinch inside a TabBarView. The PdfViewPinch is in the first tab and see it proper. Press on second tab and the second tab it show proper. Click back on the first tab and the PdfViewPinch is disappeared.

Note that no issues if I'm using PdfView.

Screenshots 1 2 3

Emulator

  • OS: Android, not tested on iOS
  • Version: API 29

Thanks

Paroca72 avatar Aug 24 '23 03:08 Paroca72

Unfortunately, I can confirm this issue on Android.

Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 796c8ef792 (5 months ago) • 2023-06-13 15:51:02 -0700
Engine • revision 45f6e00911
Tools • Dart 3.0.5 • DevTools 2.23.1

pdfx version: 2.4.0

cadivus avatar Nov 14 '23 23:11 cadivus

I found a work-around. I created the "pdf" tab using a StatefulWidget with AutomaticKeepAliveClientMixin. In my case it also better because not redraw the tab when you changes index.

Paroca72 avatar Nov 17 '23 13:11 Paroca72

@Paroca72 Thanks a lot, this works!

cadivus avatar Nov 17 '23 19:11 cadivus