CrossPT / flutter_plugin_pdf_viewer

A flutter plugin for handling PDF files. Works on both Android & iOS
BSD 3-Clause "New" or "Revised" License
92 stars 317 forks source link

Hide BottomNavigationBar when document have just one page. #78

Open ThiagoBfim opened 4 years ago

ThiagoBfim commented 4 years ago

I Had some problemens when i tried to use a pdf with just one page. I want to hide BottomNavigationBar, but it's impossible.

Code with error:

`void main() => runApp(MyApp());

class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); }

class _MyAppState extends State { bool _isLoading = true; PDFDocument document;

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

loadDocument() async { document = await PDFDocument.fromURL('https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf'); setState(() => _isLoading = false); }

@override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: const Text('FlutterPluginPDFViewer'), ), body: Center( child: _isLoading ? Center(child: CircularProgressIndicator()) : PDFViewer(document: document, showNavigation: false,)), ), ); } } `