bindings library

Copyright © 2018-2026 PSPDFKit GmbH. All rights reserved.

THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT. UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. This notice may not be removed from this file.

One-stop entry point for the bindings-based Nutrient Flutter API.

Import this library instead of package:nutrient_flutter/nutrient_flutter.dart when you want to build against the bindings surface (NutrientPlatformAdapter, NutrientController, NutrientControllerInterface, typed NutrientEvent stream, etc.) rather than the legacy method-channel surface.

import 'package:nutrient_flutter/bindings.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Nutrient.initialize(androidLicenseKey: 'YOUR_LICENSE_KEY');
  // Optional: register a custom controller type, then select it per view
  // via NutrientDocumentView<MyController>.
  Nutrient.addAdapterClass<MyController>(() => createMyAdapter());
  runApp(const MyApp());
}

This library re-exports:

  • All cross-platform bindings types from nutrient_flutter_platform_interface (Nutrient, NutrientController, NutrientControllerInterface, NutrientPlatformAdapter, NutrientDocumentInterface, NutrientViewConfiguration, the typed NutrientEvent sealed class hierarchy, etc.).
  • NutrientDocumentView — the adapter-driven view widget.

Writing a custom adapter

Adapter base classes live in the per-platform packages and pull in platform-specific bindings, so they're not re-exported here. Import them directly from the platform package (you'll typically only reference the one for the platform you're targeting):

// ignore: depend_on_referenced_packages
import 'package:nutrient_flutter_android/nutrient_flutter_android.dart';

class MyAndroidAdapter extends AndroidAdapter { /* ... */ }

The depend_on_referenced_packages ignore is needed because the per-platform packages are transitive dependencies of nutrient_flutter (not direct deps of your app) — declaring them as direct deps would prevent the Flutter plugin tooling from registering nutrient_flutter itself as an Android plugin.

Legacy API

The Pigeon-generated method-channel types still live on package:nutrient_flutter/nutrient_flutter.dart (Nutrient.present(), the legacy Bookmark/PageInfo/AnnotationProperties/NutrientEvent enums, etc.). They are deprecated for the bindings flow but kept around for backwards compatibility — see the legacy example app for usage.

Classes

Action
Base class for all annotation actions
AndroidViewConfiguration
Android-specific viewer configuration options.
Annotation
Base class for all Nutrient annotations
AnnotationAttachment
Represents an attachment for an annotation
AnnotationCollection
Helper class to handle collections of annotations
AnnotationColors
Predefined colors for annotations
AnnotationCreatedEvent
Emitted when one or more annotations are created.
AnnotationDeletedEvent
Emitted when one or more annotations are deleted.
AnnotationDeselectedEvent
Emitted when the user deselects one or more annotations.
AnnotationManagerInterface
Abstract interface for annotation operations on a PDF document.
AnnotationProperties
Typed representation of annotation properties.
AnnotationSelectedEvent
Emitted when the user selects one or more annotations.
AnnotationToolbarItem
A single item in the viewer's annotation creation toolbar (the tool picker shown when you enter annotation mode).
AnnotationToolGroup
A collapsible group of AnnotationTools in the annotation creation toolbar.
AnnotationUpdatedEvent
Emitted when one or more annotations are modified.
Bookmark
Copyright © 2018-2026 PSPDFKit GmbH. All rights reserved.
BookmarkFactory
Factory methods for creating Bookmark instances.
BookmarkManagerInterface
Abstract interface for bookmark operations on a PDF document.
ButtonFormField
CaretAnnotation
Caret annotation
CheckBoxFormField
CircleAnnotation
Circle annotation
ComboBoxFormField
CustomToolbarItem
A custom toolbar button backed by a Dart onPressed callback. Works on Android, iOS, and Web.
DocumentErrorEvent
Emitted when a document fails to load.
DocumentLoadedEvent
Emitted when a document is fully loaded and ready for interaction.
DocumentPathResolver
Utility class to resolve document paths for native platforms.
DocumentSavedEvent
Emitted after a document is successfully saved.
DocumentSaveOptions
Options controlling how a PDF document is saved or exported.
EmbeddedFile
Represents an embedded file that can be attached to a FileAnnotation
FileAnnotation
File attachment annotation
FormFieldUpdatedEvent
Emitted when a form field value changes.
FormManagerInterface
Abstract interface for form field operations on a PDF document.
FreeTextAnnotation
Free text annotation
GoToAction
Action to navigate to a specific page and position
HighlightAnnotation
Represents a highlight annotation in PSPDFKit
ImageAnnotation
Image annotation
InkAnnotation
Represents an ink annotation in PSPDFKit
InkLines
Represents the lines data in an ink annotation
InstantAuthFailedEvent
Emitted when Instant JWT authentication or re-authentication fails.
InstantAuthFinishedEvent
Emitted when Instant JWT re-authentication completes successfully.
InstantSyncFailedEvent
Emitted when an Instant document sync fails.
InstantSyncFinishedEvent
Emitted when an Instant document sync completes successfully.
InstantSyncStartedEvent
Emitted when an Instant document begins syncing to the server.
IOSViewConfiguration
iOS-specific viewer configuration options.
LineAnnotation
Line annotation for drawing straight lines on a page
LineCaps
Line caps for line annotations
LinkAnnotation
Link annotation
ListBoxFormField
MeasurementScale
The scale of the document. The scale is used to convert between real world measurements and points. The default scale is 1 inch = 1 inch.
MeasurementValueConfiguration
NativeInstanceRegistry
Registry for native instances.
NoteAnnotation
Represents a note annotation in PSPDFKit
Nutrient
Main entry point for the Nutrient Flutter Bindings plugin.
NutrientAnnotationToolbarItemsCallbackOptions
Copyright © 2024-2026 PSPDFKit GmbH. All rights reserved.
NutrientController
Base class for Nutrient controllers.
NutrientControllerInterface
Pure interface for the Nutrient viewer controller.
NutrientDocumentInterface
Abstract interface representing an open PDF document.
NutrientDocumentView<T extends NutrientController>
A widget for displaying PDF and image documents with typed controller access.
NutrientEvent
Base class for all cross-platform Nutrient SDK events.
NutrientFlutterPlatform
The interface that implementations of nutrient_flutter must implement.
NutrientInstantController
Controller for an Instant (real-time collaboration) document, surfaced by NutrientInstantView.onControllerReady.
NutrientInstantView<T extends NutrientInstantController>
A cross-platform widget that opens a Nutrient Instant document.
NutrientPlatformAdapter
Platform adapter interface for extending Nutrient functionality.
NutrientViewConfiguration
Typed viewer configuration for bindings-based Nutrient views.
NutrientViewHandle
Copyright © 2018-2026 PSPDFKit GmbH. All rights reserved.
NutrientWebAnnotationToolbarItem
NutrientWebToolbarItem
Copyright © 2024-2026 PSPDFKit GmbH. All rights reserved.
OfficeConversionSettings
Copyright © 2024-2026 PSPDFKit GmbH. All rights reserved.
PageChangedEvent
Emitted when the viewer navigates to a different page.
PageClickedEvent
Emitted when the user taps on a page.
PageInfo
Copyright © 2018-2026 PSPDFKit GmbH. All rights reserved.
PdfConfigurationBuilder
Copyright © 2018-2026 PSPDFKit GmbH. All rights reserved.
PdfFormField
PdfTextFormField
PolygonAnnotation
Polygon annotation
PolylineAnnotation
Polyline annotation
PopupAnnotation
Popup annotation
RadioButtonFormField
RedactionAnnotation
Redaction annotation
RichMediaAnnotation
Rich media annotation
ScreenAnnotation
Screen annotation
ShapeAnnotation
Shape annotation base class for square, circle, and polygon annotations
SignatureColorOptions
The set of color presets offered in the signature creation UI.
SignatureColorPreset
A color preset offered in the signature creation UI.
SignatureCreationConfiguration
Configuration for the signature creation UI.
SignatureFormField
SoundAnnotation
Sound annotation
SquareAnnotation
Square annotation
SquigglyAnnotation
Squiggly annotation
StampAnnotation
Stamp annotation
StrikeoutAnnotation
Strikeout annotation
SubmitFormAction
Action to submit form data to a URL
TextContent
Text content for annotations
TextMarkupAnnotation
Base class for text markup annotations (highlight, underline, strikeout, squiggly)
TextSelectionChangedEvent
Emitted when the user's text selection changes.
ToolbarItem
A single item in the viewer's main toolbar.
Type3DAnnotation
3D annotation
UnderlineAnnotation
Underline annotation
UriAction
Action to open a URL in a web browser
WatermarkAnnotation
Watermark annotation
WebViewConfiguration
Web-specific viewer configuration options.
WidgetAnnotation
Widget annotation (form fields)

Enums

AnnotationEditingItem
Copyright © 2018-2026 PSPDFKit GmbH. All rights reserved.
AnnotationFlag
Flags that control the behavior and appearance of annotations. See the PDF Reference for details.
AnnotationProcessingMode
AnnotationTool
Copyright © 2018-2026 PSPDFKit GmbH. All rights reserved.
AnnotationType
Represents the native annotation type.
AppearanceMode
The appearance (colour scheme) of the viewer.
AutoSaveMode
BlendMode
Blend mode for annotations
BorderEffect
BorderStyle
Represents the border style for annotations.
DocumentPermissions
Copyright © 2018-2026 PSPDFKit GmbH. All rights reserved.
FileIconName
HorizontalTextAlignment
Text alignment options for free text annotations
IOSBookmarkIndicatorMode
The mode for displaying a bookmark indicator on individual pages.
IOSFileConflictResolution
Resolution options for file conflicts due to out-of-process file changes or deletion on iOS.
LineCapType
Line cap type for line annotations
MeasurementPrecision
Copyright © 2023-2026 PSPDFKit GmbH. All rights reserved.
NoteIcon
Note icon types
NutrientAndroidSignatureOrientation
Orientation of the signature creation dialog on Android.
NutrientWebAnnotationToolbarItemType
Copyright © 2024-2026 PSPDFKit GmbH. All rights reserved.
NutrientWebInteractionMode
Defines the available interaction modes for the PSPDFKit Flutter plugin on the web platform.
NutrientWebToolbarItemType
Copyright © 2024-2026 PSPDFKit GmbH. All rights reserved.
PageLayoutMode
Page layout mode — single page, double-page spread, or automatic.
PageTransition
The page transition animation used when changing pages.
PdfFormFieldTypes
PdfVersion
The PDF version to target when saving a document.
ScrollDirection
Copyright © 2018-2026 PSPDFKit GmbH. All rights reserved.
ShowSignatureValidationStatusMode
An enum that represents the mode for showing signature validation status.
SidebarMode
Enum representing the different sidebar modes available in PSPDFKit.
SignatureCreationMode
How a signature can be created in the signature creation UI.
SignatureSavingStrategy
When the signature creation UI offers to save a newly created signature.
SpreadFitting
How a page spread is fitted into the available viewport.
StampType
TextAlignment
Represents the text alignment for free text annotations.
TextFormat
Text format for annotations
ThumbnailBarMode
Where and how the thumbnail bar is displayed.
ToolbarItemType
A built-in toolbar item — drop these straight into NutrientControllerInterface.setMainToolbarItems (each value is itself a ToolbarItem).
ToolbarPlacement
An enum to represent the placement of the PSPDFKit toolbar.
UnitFrom
Copyright © 2023-2026 PSPDFKit GmbH. All rights reserved.
UnitTo
UserInterfaceViewMode
Controls when the viewer toolbar and overlays are shown.
VerticalAlignment
Vertical alignment options for free text annotations
ZoomMode
Enum representing the different zoom modes available in PSPDFKit.

Mixins

AnnotationEventData
Mixin providing a typed annotations view over an event's raw annotationsJson. Parsing is defensive (Annotation.tryFromJson) so an unknown or malformed entry is skipped rather than throwing.
HasAttachment
Mixin for annotations that can have attachments

Extensions

AnnotationFlagExtension on AnnotationFlag
Extension on AnnotationFlag to convert between enum values and strings.
AnnotationManagerTyped on AnnotationManagerInterface
Typed convenience layer over the JSON transport on AnnotationManagerInterface.
AnnotationPropertiesGetters on AnnotationProperties
Extension for convenient getters on AnnotationProperties.
AnnotationPropertiesModification on AnnotationProperties
Extension to add modification methods to AnnotationProperties. These methods create new instances with updated values, following an immutable pattern.
AnnotationTypeExtension on AnnotationType
Extension on AnnotationType to provide additional functionality
AppearanceModeWebName on AppearanceMode
Extension that provides the Web SDK string name for AppearanceMode values.
BookmarkExtensions on Bookmark
Extension methods for the Bookmark class to provide convenience constructors and utility methods.
ColorToHex on Color?
Extension to convert Color to hex string
FileIconNameExtension on FileIconName
FormManagerTyped on FormManagerInterface
Typed convenience layer over the JSON transport on FormManagerInterface.
FreeTextAnnotationProperties on AnnotationProperties
Extension for free text annotation properties.
HexToColor on String
Extension to convert hex string to Color
InkAnnotationProperties on AnnotationProperties
Extension for ink annotation property updates.
MeasurementPrecisionExtension on MeasurementPrecision
NoteAnnotationProperties on AnnotationProperties
Extension for note annotation properties.
NoteIconExtension on NoteIcon
NutrientEventStreamX on Stream<NutrientEvent>
Typed filter getters for Stream<NutrientEvent>.
PageLayoutModeWebName on PageLayoutMode
Extension that provides the Web SDK string name for PageLayoutMode values.
PageTransitionWebName on PageTransition
Extension that provides the Web SDK string name for PageTransition values.
PdfFormFieldTypesExtension on PdfFormFieldTypes
Copyright © 2024-2026 PSPDFKit GmbH. All rights reserved.
StampTypeExtension on StampType
UnitFromExtension on UnitFrom
UnitToExtension on UnitTo
WebAnnotationToolbarTypeX on NutrientWebAnnotationToolbarItemType
WebToolbarItemTypeX on NutrientWebToolbarItemType

Constants

kImageDocumentExtensions → const Set<String>
Copyright © 2018-2026 PSPDFKit GmbH. All rights reserved.

Functions

annotationTypeFromString(String annotationString) AnnotationType
instantDocumentIdFromJwt(String jwt) String
Extracts the document_id claim from an Instant (Document Engine) JWT.
isImageDocumentPath(String? path) bool
Whether path points at an image document (vs. a PDF), detected purely by file extension.