PdfThumbnailView class
A dedicated, full-area page thumbnail grid - the same page controls as PdfThumbnailSidebar (click to select a page, double-click to open it, shift/⌘-click multi-select with a bulk-action bar, per-tile rotate/delete, drag to reorder, the page-actions menu, and the Add-page footer), laid out as a reflowing grid whose tile size the header's size control changes. Use it as a page-organizer view in place of the page viewer.
Unlike the strip, a plain click only selects the page. A double-click scrolls the viewer to that page and fires onOpenPage (the host turns the grid off to reveal the page). Shift/⌘ clicks only extend the multi-selection, so a selection can be built without the view jumping.
The tiles reuse the strip's serialized, render-stamp-keyed thumbnail cache, so an edit re-rasterizes only the pages it touched. The chosen tile width persists via PdfEditingPreferences.thumbnailViewTileWidth.
PdfThumbnailView(
controller: editing,
viewerController: viewerController,
onOpenPage: (_) => setState(() => showGrid = false),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PdfThumbnailView
Constructors
-
PdfThumbnailView({Key? key, required PdfEditingController controller, required PdfViewerController viewerController, Color pageColor = const Color(0xFFFFFFFF), bool showAnnotations = true, bool allowPageEditing = true, Future<
Uint8List?> onPickPdfToInsert()?, PdfPickInsertFiles? onPickPdfFilesToInsert, void onExportPages(Uint8List bytes)?, void onSplitPages(List<Uint8List> documents)?, PdfThumbnailDropController? fileDropController, void onOpenPage(int pageIndex)?, PdfRenderWorker? renderWorker, PdfRasterCache? rasterCache, double minTileWidth = 96, double maxTileWidth = 360, double defaultTileWidth = 168}) -
const
Properties
- allowPageEditing → bool
-
Whether pages can be reordered (drag), rotated, deleted, and added.
False makes the grid a read-only page picker.
final
- controller → PdfEditingController
-
final
- defaultTileWidth → double
-
The tile width used until the size control (or a stored preference)
sets one.
final
- fileDropController → PdfThumbnailDropController?
-
Lets a PDF dragged in from outside the app be dropped between two
tiles, at the marked position in the page order. The host drives the
controller from the platform's drag stream; the grid supplies the
geometry. See PdfThumbnailDropController.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
Annotation subtypes thumbnails leave out - pass the viewer's
PdfViewer.hiddenAnnotationSubtypes so they match the pages.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxTileWidth → double
-
final
- minTileWidth → double
-
Clamps for the tile-size control.
final
- onExportPages → void Function(Uint8List bytes)?
-
Receives the bytes of an exported page range; null hides the
"Export pages…" page-action and the selection bar's export.
final
- onOpenPage → void Function(int pageIndex)?
-
Called after a double-click scrolls the viewer to
pageIndex. Hosts that show the grid in place of the viewer turn it off here so the chosen page shows.final - onPickPdfFilesToInsert → PdfPickInsertFiles?
-
Picks PDFs for the multi-document insert dialog. See
PdfThumbnailSidebar.onPickPdfFilesToInsert.
final
-
onPickPdfToInsert
→ Future<
Uint8List?> Function()? -
Picks a PDF to insert after the current page; null hides the
"Insert PDF…" page-action. See PdfThumbnailSidebar.onPickPdfToInsert.
final
-
onSplitPages
→ void Function(List<
Uint8List> documents)? -
Receives one standalone PDF per range from "Split PDF…". When null,
that action is hidden. Outputs follow the user's range order.
final
- pageColor → Color
-
The paper color thumbnails render on (match the viewer's).
final
- rasterCache → PdfRasterCache?
-
Optional persistent on-disk thumbnail cache, bound to the open document.
See PdfThumbnailSidebar.rasterCache.
final
- renderWorker → PdfRenderWorker?
-
Offloads tile interpretation to a background isolate - pass the same
worker the viewer uses. See PdfThumbnailSidebar.renderWorker.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showAnnotations → bool
-
Whether thumbnails render their annotations (match the viewer's).
final
- viewerController → PdfViewerController
-
The viewer a tapped tile scrolls to (see onOpenPage).
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PdfThumbnailView> -
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