nextPage method
void
nextPage()
Navigates to the next page of a PDF document.
Using this method, the SfPdfViewer navigates to the next page of a PDF document. If the next page doesn't exists, then the navigation will not happen and the older page will be retained.
Returns null.
This example demonstrates how to navigate to the next and previous page.
class MyAppState extends State<MyApp>{
late PdfViewerController _pdfViewerController;
@override
void initState(){
_pdfViewerController = PdfViewerController();
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Syncfusion Flutter PdfViewer'),
actions: <Widget>[
IconButton(
icon: Icon(
Icons.keyboard_arrow_down,
color: Colors.white,
),
onPressed: () {
_pdfViewerController.nextPage();
},
),
],
),
body: SfPdfViewer.asset(
'assets/flutter-succinctly.pdf',
controller: _pdfViewerController,
),
),
);
}
}
Implementation
void nextPage() {
_pageNavigator = Pagination(Navigation.nextPage);
_notifyPropertyChangedListeners(property: 'pageNavigate');
}