NutrientInstantController class abstract
Controller for an Instant (real-time collaboration) document, surfaced by NutrientInstantView.onControllerReady.
Extends the cross-platform NutrientController surface with the sync
controls that are only meaningful for Instant documents. These used to live
on NutrientDocumentInterface where they threw for non-Instant documents;
they now live here so the type system only exposes them where they apply.
Declared as implements NutrientController (the same shape as custom
controller interfaces in the adapter architecture) so it satisfies
Nutrient.buildAdapter<T extends NutrientController> — the platform
implementations (AndroidInstantController, IOSInstantController) extend
their platform adapters, which already provide the controller surface.
NutrientInstantView(
serverUrl: url,
jwt: jwt,
onControllerReady: (controller) async {
await controller.setDelayForSyncingLocalChanges(2);
await controller.setListenToServerChanges(true);
await controller.syncAnnotations();
},
)
Supported on Android and iOS. On Web, Instant sync is configured at load time, so these methods throw UnsupportedError.
- Implemented types
Constructors
Properties
- document → NutrientDocumentInterface
-
The open PDF document and its document-level operations.
no setterinherited
-
events
→ Stream<
NutrientEvent> -
A broadcast stream of cross-platform typed SDK events.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
Whether the controller has been disposed.
no setterinherited
- isReady → bool
-
Whether the controller is ready for use.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- viewHandle → NutrientViewHandle?
-
The internal view handle for accessing native instances.
no setterinherited
Methods
-
attachViewHandle(
NutrientViewHandle viewHandle) → void -
Attach the view handle to this controller.
inherited
-
consumeViewAttached(
) → bool -
For platform adapters: atomically check-and-clear the view-attached flag.
inherited
-
convertPdfPointToViewPoint(
int pageIndex, Offset point) → Future< Offset> -
Converts a point from PDF page coordinates to the page view's
coordinate space.
inherited
-
convertViewPointToPdfPoint(
int pageIndex, Offset point) → Future< Offset> -
Converts a point from the page view's coordinate space to PDF page
coordinates.
inherited
-
dispose(
) → Future< void> -
Dispose of this controller and release resources.
inherited
-
emitEvent(
NutrientEvent event) → void -
Emits a cross-platform event to all events subscribers.
inherited
-
enterAnnotationCreationMode(
[AnnotationTool? annotationTool]) → Future< bool?> -
Enters annotation creation mode for the specified
annotationTool.inherited -
exitAnnotationCreationMode(
) → Future< bool?> -
Exits annotation creation mode and returns to normal viewer
interaction.
inherited
-
getVisibleRect(
int pageIndex) → Future< Rect> -
Gets the visible rect of the given page.
inherited
-
getZoomScale(
int pageIndex) → Future< double> -
Gets the current zoom scale of the given page.
inherited
-
markReady(
) → Future< void> -
Mark the controller as ready for use.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onReady(
) → Future< void> -
Called when the controller becomes ready.
inherited
-
setAnnotationConfigurations(
Map< String, dynamic> configurations) → Future<bool> -
Sets annotation preset configurations for the viewer's annotation toolbar.
inherited
-
setAnnotationEditingToolbarItems(
List< AnnotationEditingItem> items) → Future<void> -
No-op default — annotation editing toolbar customization is opt-in per
platform (Web/Android/iOS adapters override this).
inherited
-
setAnnotationMenuConfiguration(
Map< String, dynamic> configuration) → Future<bool> -
Configures the annotation context menu (items to show, disable, or hide).
inherited
-
setAnnotationToolbarItems(
List< AnnotationToolbarItem> items) → Future<void> -
No-op default — annotation creation toolbar customization is opt-in per
platform (Android/iOS adapters override this; Web routes annotation tools
through the main toolbar).
inherited
-
setDelayForSyncingLocalChanges(
double delay) → Future< bool> - Sets the delay (in seconds) before local changes are synced to the server.
-
setListenToServerChanges(
bool listen) → Future< bool> - Enables or disables listening for changes made on the server.
-
setMainToolbarItems(
List< ToolbarItem> items) → Future<void> -
No-op default — toolbar customization is opt-in per platform. The
Android/iOS/Web adapters override this; controllers that don't support it
simply ignore the request.
inherited
-
syncAnnotations(
) → Future< bool> - Triggers an immediate annotation sync with the Instant server.
-
toString(
) → String -
A string representation of this object.
inherited
-
zoomToRect(
int pageIndex, Rect rect) → Future< void> -
Zooms to the given
recton the given page.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited