Create a StatefulWidget for your PDF viewer widget:
class PdfViewer extends StatefulWidget {
final int startPage;
final int endPage;
PdfViewer({required this.startPage, required this.endPage});
@override
_PdfViewerState createState() => _PdfViewerState();
}
Make sure to replace 'path/to/your/pdf/document.pdf' with the actual path to your PDF document.
In this example, the PDFViewController's setPageFragments method is used to set the specific page range of the PDF document. The onPageChanged callback is used to update the current page number in the bottom navigation bar.
Note: Make sure to handle exceptions or error scenarios during the PDF document loading by using error handling mechanisms provided by the flutter_pdfview package.