PdfViewer class

A widget that displays a PDF with a thumbnail sidebar for navigation.

This widget combines a PDF viewer with a sidebar that shows thumbnails of all pages. Users can navigate through the PDF by swiping or by tapping on thumbnails in the sidebar.

Inheritance

Constructors

PdfViewer({Key? key, required String pdfPath, bool initialSidebarOpen = false, double sidebarWidth = 160, double thumbnailHeight = 150, Color sidebarBackgroundColor = Colors.grey, BoxDecoration? selectedPageDecoration})
Creates a PdfViewer widget.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
initialSidebarOpen bool
Whether the sidebar should be initially open
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
pdfPath String
Path to a PDF file. Can be a URL (starting with http:// or https://) or an asset path
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedPageDecoration BoxDecoration?
Optional decoration for the selected page thumbnail
final
sidebarBackgroundColor Color
Background color of the sidebar
final
sidebarWidth double
Width of the sidebar containing thumbnails
final
thumbnailHeight double
Height of each thumbnail in the sidebar
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<PdfViewer>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited