PdfViewer constructor

const PdfViewer({
  1. Key? key,
  2. required String pdfPath,
  3. bool initialSidebarOpen = false,
  4. double sidebarWidth = 160,
  5. double thumbnailHeight = 150,
  6. Color sidebarBackgroundColor = Colors.grey,
  7. BoxDecoration? selectedPageDecoration,
  8. bool showZoomHint = true,
})

Creates a PdfViewer widget.

The pdfPath parameter is required and should point to a valid PDF file. It can be either a URL (starting with http:// or https://) or an asset path.

The initialSidebarOpen parameter determines whether the thumbnail sidebar is initially visible.

The sidebarWidth parameter sets the width of the thumbnail sidebar.

The thumbnailHeight parameter sets the height of each thumbnail in the sidebar.

The sidebarBackgroundColor parameter sets the background color of the sidebar.

The selectedPageDecoration parameter sets the decoration for the selected page thumbnail.

The showZoomHint parameter determines whether to show an animated hint indicating that the user can pinch to zoom. Defaults to true.

Implementation

const PdfViewer({
  super.key,
  required this.pdfPath,
  this.initialSidebarOpen = false,
  this.sidebarWidth = 160,
  this.thumbnailHeight = 150,
  this.sidebarBackgroundColor = Colors.grey,
  this.selectedPageDecoration,
  this.showZoomHint = true,
});