binSaed / flutter_cached_pdfview

Enhanced PDF view for Flutter.
https://pub.dev/packages/flutter_cached_pdfview
MIT License
121 stars 70 forks source link

Blank screen is displayed when change orientation #24

Closed yazanIbrahim closed 3 years ago

yazanIbrahim commented 4 years ago

a blank screen is displayed when changing orientation

Steps to reproduce the behavior:

  1. open a pdf from URL
  2. change orientation from portrait to landscape and vise versa

Expected behaviour the pdf file should continue displaying

Smartphone (please complete the following information):

sample code ` class PDFViewer extends StatefulWidget { final String url;

PDFViewer({@required this.url});

@override _PDFViewerState createState() => _PDFViewerState(); }

class _PDFViewerState extends State {

@override Widget build(BuildContext context) { return View( builder: (context, model, child) { return Scaffold( body: SafeArea( child: PDF( nightMode: true, onError: (error){ print("err"); print(error.toString()); } ).cachedFromUrl( widget.url, placeholder: (progress) => Center(child: Text('$progress %')), errorWidget: (error) => Center(child: Text(error.toString())), ), ), ); }, ); } }`

binSaed commented 4 years ago

hi @yazanIbrahim please take a look at this workaround https://github.com/endigo/flutter_pdfview/issues/9#issuecomment-532824876