DocumentLoadFailure class

Why a document failed to open in a Nutrient view.

Delivered to NutrientInstantView.onDocumentLoadFailed. A view that reports this will never load — the viewer stays on its loading/error state until the host app rebuilds the widget — so treat it as terminal and render your own error UI (with a retry that remounts the view) rather than waiting for a later success callback.

NutrientInstantView(
  serverUrl: serverUrl,
  jwt: jwt,
  onDocumentLoadFailed: (failure) {
    setState(() => _error = failure.message);
    if (failure.code == 'REQUEST_FAILED') {
      // Offline or server unreachable — worth offering a retry.
    }
  },
)
Annotations

Constructors

DocumentLoadFailure({required String message, String? type, String? code})
Creates a DocumentLoadFailure.
const
DocumentLoadFailure.fromMap(Object? arguments)
Builds a DocumentLoadFailure from a platform-channel payload.
factory

Properties

code → String?
The Instant error code, when the failure came from Instant and the platform reports one — for example REQUEST_FAILED (server unreachable, typically offline), AUTHENTICATION_FAILED (rejected or expired JWT), or INVALID_JWT.
final
hashCode → int
The hash code for this object.
no setteroverride
message → String
A human-readable description of the failure, suitable for logging.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → String?
The native error type that caused the failure, when the platform reports one — for example InstantDownloadException or InstantException on Android.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override