lohanidamodar / pdf_viewer

A flutter plugin for handling PDF files. Works on both Android & iOS
https://pub.dev/packages/advance_pdf_viewer
BSD 3-Clause "New" or "Revised" License
61 stars 144 forks source link

Infinite CircularProgressIndicator #111

Closed erwinagpasa closed 2 years ago

erwinagpasa commented 2 years ago

I copied the code

bool _isLoading = true; late PDFDocument document;

@override void initState() { super.initState(); loadDocument(); }

loadDocument() async { document = await PDFDocument.fromURL('http://www.africau.edu/images/default/sample.pdf'); setState(() => _isLoading = false);

}

In my scaffold

Center( child: _isLoading ? const Center(child: CircularProgressIndicator()) : PDFViewer( document: document, zoomSteps: 1, scrollDirection: Axis.vertical, showPicker: false, ), ),

erwinagpasa commented 2 years ago

Fixed

  1. Run flutter clean
  2. Then pub get