NutrientInstantView<T extends NutrientInstantController> class

A cross-platform widget that opens a Nutrient Instant document.

NutrientInstantView connects to a Document Engine server using the provided serverUrl and jwt credentials and renders the resulting document with real-time collaboration support.

The controller surfaced by onControllerReady is a NutrientInstantController — the regular controller surface plus the Instant sync controls (syncAnnotations, setDelayForSyncingLocalChanges, setListenToServerChanges).

Controller resolution mirrors NutrientDocumentView:

  • Bare NutrientInstantView(...) — the platform's default Instant controller is built fresh for this view (and disposed with it).
  • Typed NutrientInstantView<MyInstantController>(...) — a fresh instance from the factory registered with Nutrient.addAdapterClass<MyInstantController>(...); the view owns its lifecycle.
  • Per-view instance via adapter — you allocate and dispose it; the view only attaches/detaches.

Example:

NutrientInstantView(
  serverUrl: 'https://your-server.example.com/api/1/documents/abc123',
  jwt: 'eyJhbGci...',
  configuration: NutrientViewConfiguration(
    pageLayoutMode: PageLayoutMode.single,
  ),
  onControllerReady: (controller) async {
    await controller.setDelayForSyncingLocalChanges(2);
    await controller.syncAnnotations();
  },
)
Inheritance

Constructors

NutrientInstantView({Key? key, required String serverUrl, required String jwt, NutrientViewConfiguration? configuration, void onViewCreated(NutrientViewHandle handle)?, T? adapter, void onControllerReady(T controller)?})
Creates a NutrientInstantView.
const

Properties

adapter → T?
Optional per-view controller instance you own.
final
configuration NutrientViewConfiguration?
Optional viewer configuration.
final
hashCode int
The hash code for this object.
no setterinherited
jwt String
The JWT used to authenticate with the Document Engine server.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onControllerReady → void Function(T controller)?
Called when the Instant controller is ready.
final
onViewCreated → void Function(NutrientViewHandle handle)?
Called when the platform view has been created and is ready to use.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverUrl String
The Document Engine server URL for the Instant document to open.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<NutrientInstantView<T>>
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