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

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.

Implementation

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