diff --git a/lib/src/viewer.dart b/lib/src/viewer.dart index 9326a22..18f1284 100644 --- a/lib/src/viewer.dart +++ b/lib/src/viewer.dart @@ -140,64 +140,65 @@ class _PDFViewerState extends State { ) : null, floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, - bottomNavigationBar: (widget.showNavigation || widget.document.count > 1) - ? BottomAppBar( - child: new Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: IconButton( - icon: Icon(Icons.first_page), - tooltip: widget.tooltip.first, - onPressed: () { - _pageNumber = 1; - _loadPage(); - }, - ), - ), - Expanded( - child: IconButton( - icon: Icon(Icons.chevron_left), - tooltip: widget.tooltip.previous, - onPressed: () { - _pageNumber--; - if (1 > _pageNumber) { - _pageNumber = 1; - } - _loadPage(); - }, - ), + bottomNavigationBar: Visibility( + visible: (widget.showNavigation && widget.document.count > 1), + child: BottomAppBar( + child: new Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: IconButton( + icon: Icon(Icons.first_page), + tooltip: widget.tooltip.first, + onPressed: () { + _pageNumber = 1; + _loadPage(); + }, ), - widget.showPicker - ? Expanded(child: Text('')) - : SizedBox(width: 1), - Expanded( - child: IconButton( - icon: Icon(Icons.chevron_right), - tooltip: widget.tooltip.next, - onPressed: () { - _pageNumber++; - if (widget.document.count < _pageNumber) { - _pageNumber = widget.document.count; - } - _loadPage(); - }, - ), + ), + Expanded( + child: IconButton( + icon: Icon(Icons.chevron_left), + tooltip: widget.tooltip.previous, + onPressed: () { + _pageNumber--; + if (1 > _pageNumber) { + _pageNumber = 1; + } + _loadPage(); + }, ), - Expanded( - child: IconButton( - icon: Icon(Icons.last_page), - tooltip: widget.tooltip.last, - onPressed: () { + ), + widget.showPicker + ? Expanded(child: Text('')) + : SizedBox(width: 1), + Expanded( + child: IconButton( + icon: Icon(Icons.chevron_right), + tooltip: widget.tooltip.next, + onPressed: () { + _pageNumber++; + if (widget.document.count < _pageNumber) { _pageNumber = widget.document.count; - _loadPage(); - }, - ), + } + _loadPage(); + }, ), - ], - ), - ) - : Container(), + ), + Expanded( + child: IconButton( + icon: Icon(Icons.last_page), + tooltip: widget.tooltip.last, + onPressed: () { + _pageNumber = widget.document.count; + _loadPage(); + }, + ), + ), + ], + ), + ) + ), ); } }