Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide BottomNavigationBar when document have just one page. #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ThiagoBfim
Copy link

@ThiagoBfim ThiagoBfim commented Aug 6, 2020

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,)),
),
);
}
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant