nutrient_flutter_android 2.1.0
nutrient_flutter_android: ^2.1.0 copied to clipboard
Android implementation of the nutrient_flutter plugin.
2.1.0 19 Nov 2026 #
- Implements
setSignatureInterceptoron top of the Android SDK'sPdfFragment.signatureCreationInterceptor. Both entry points are covered: the signature tool and signature form fields. (L#HYB-1044) - Applies
AndroidViewConfiguration.showStylusButtononNutrientViewthroughAnnotationToolbar.setShouldShowStylusButton().NutrientInstantViewbuilds a plainInstantPdfUiFragmentand ignores the option. (J#HYB-1023) - Ships R8 keep rules for
FragmentContainerPlatformView, which the plugin's Dart code calls over JNI by name. Nothing kept it before, so R8 in a release build could rename or remove it, andNutrientViewandNutrientInstantViewwould fail to reach it at runtime. (L#AND-2183) - Builds with compileSdk 37.1, Android Gradle Plugin 9.2.1, Gradle 9.5.1 and Kotlin 2.4.10, the versions the Nutrient Android SDK now builds with. Apps must set
compileSdk = 37andcompileSdkMinor = 1explicitly, becauseflutter.compileSdkVersionstill reports 36, and use Kotlin Gradle plugin 2.3 or later, which can read Kotlin 2.4 metadata. (L#HYB-1086) - Updates to Nutrient Android SDK 12.1.0. Regenerates the JNI bindings against it; bindings for the APIs 12.1.0 removed are gone, including the RxJava and blocking
AnnotationProvidermethods; use the plugin'sAnnotationProviderBlockinginstead. (L#HYB-1109) - Raises the
jnidependency to^1.1.0, which JNI bindings generated by jnigen 1.0 require. (L#HYB-1103) - Moves
NutrientViewonto the Android SDK's Compose toolbars: the toolbar grouping rule, the stylus button option and custom main-toolbar items now go through the fragment'sToolbarCoordinator. The Flutter API is unchanged. (L#HYB-1085) - Keeps the Android annotation and form managers and
AnnotationProviderBlockingworking with the Nutrient Android SDK releases after 12.0.0. Those releases removed the SDK's blocking and RxJava annotation companions, and madeFormProvider's lookupssuspendfunctions, which the bindings can't call. They now go through the plugin's own blocking wrappers, and the newFormProviderBlockingexposes the form lookups to adapters. (L#HYB-1105) - No longer installs a global RxJava error handler. It ignored the interrupted blocking calls the Nutrient Android SDK's RxJava APIs reported when a view was replaced, and the SDK no longer uses RxJava. (L#HYB-1105)
- Sets a
DatabaseSignatureStorageon thePdfFragmentwhenNutrientViewConfiguration.signatureSavingStrategyis set. The Android SDK can't save signatures without one, soalwaysSaveandsaveIfSelectedhad no effect. Shares the legacyPSPDFKitViewdatabase, and an adapter can still set its own storage inonFragmentReady. (L#HYB-1099, Z#134231) - Fixes release builds of apps that depend on this package:
Nutrient.initializefailed at launch with "Nutrient detected an unusual setup for your Flutter project", andNutrientViewshowed no document. R8 removed or renamed classes that are only reached by name:io.flutter.BuildConfig, which the Nutrient Android SDK looks up to confirm the app is a Flutter app;NutrientPdfUiFragment; and the AndroidX, Kotlin and Flutter classes named in the JNI bindings' method signatures. The plugin's R8 rules now keep them. - Fixes
NutrientInstantViewAndroidnever reporting a failed document open, which left the viewer on its loading indicator indefinitely — most visibly when opening a document offline that the device had not downloaded before. Failures now reach the newonDocumentLoadFailedcallback and theeventsstream as aDocumentErrorEvent, carrying the error message, the native error type, and theInstantErrorCodewhere there is one. (L#HYB-1050, Z#134164)
2.0.0 29 Jul 2026 #
- Updates to Nutrient Android SDK 11.6.1 and regenerates the JNI bindings against it. Raises the plugin's
minSdkVersionto 24 (Nougat) to match the SDK's new minimum. - Populates
PageInfo.labelfromPdfDocument.getPageLabel(int, boolean)on Android (was previously alwaysnull). Falls back tonullwhen the PDF has no explicit label dictionary entry. (J#HYB-951) - BREAKING:
io.flutter.embedding.android.FlutterAppCompatActivitymoved fromnutrient_fluttertonutrient_flutter_android, and the class is re-synced with upstreamFlutterFragmentActivityat flutter/flutter@0541913d8. The Nutrient-specific deltas are now limited to (a) extendingandroidx.appcompat.app.AppCompatActivityinstead ofandroidx.fragment.app.FragmentActivity, and (b) the class rename. The previousAiAssistantProviderintegration that delegated toPSPDFKitView.Companion.getAiAssistant()has been removed because it required reaching into the legacynutrient_flutterAndroid module. Apps that need the legacy AI Assistant binding can subclassFlutterAppCompatActivityin their own module,implements io.nutrient.domain.ai.AiAssistantProvider, and register the subclass in theirAndroidManifest.xmlinstead. Seenutrient_flutter's migration notes for details. (J#HYB-951) - Implements seven view-scoped methods on
AndroidAdaptervia JNI (thePdfFragmentandViewProjectionKotlin SDK classes):getVisibleRect,zoomToRect,getZoomScale,enterAnnotationCreationMode,exitAnnotationCreationMode,convertViewPointToPdfPoint,convertPdfPointToViewPoint. (J#HYB-952) - Adds
utils/annotation_tool_android_mapping.dartwithandroidAnnotationToolNameFor(testable, JNI-free) andtoAndroidAnnotationTool(FFI-touching) helpers, mapping the platform-interfaceAnnotationToolenum to the JNI-bound Java enum. (J#HYB-952) - Adds
utils/jni_rect_f.dart, a small raw-JNI helper that constructs and reads backandroid.graphics.RectFinstances since jnigen does not bind it. (J#HYB-952) - Wires
AndroidAdapterto drive the cross-platformeventsstream via JNI listeners onPdfFragment:DocumentListenerfor load/save/page/zoom/click,AnnotationProvider$OnAnnotationUpdatedListenerfor annotation CRUD,OnAnnotationSelectedListenerfor selection/deselection,FormManager$OnFormElementUpdatedListenerfor form field updates, andTextSelectionManager$OnTextSelectionChangeListenerfor text selection. Listener wiring runs inonPdfFragmentReadybefore the newonFragmentReadysubclass hook. (J#HYB-957) - Adds
AndroidNutrientEventsealed class andandroidEventsbroadcast stream onAndroidAdapterfor events that don't have a cross-platform equivalent:AndroidAnnotationZOrderChangedEvent,AndroidDocumentZoomedEvent,AndroidDocumentSaveFailedEvent,AndroidDocumentSaveCancelledEvent,AndroidActivityPausedEvent,AndroidFragmentAddedEvent,AndroidFormEditingModeChangedEvent,AndroidAnnotationCreationModeChangedEvent. Subclasses can call the protectedemitAndroidEvent(...)helper to push their own platform-specific events. (J#HYB-957) - Splits the
onPdfFragmentReadylifecycle hook: the SDK now wires its built-in listeners inonPdfFragmentReadyand calls a new@protected onFragmentReady(PdfFragment)hook for subclasses. Subclasses that previously overrodeonPdfFragmentReadyshould switch to overridingonFragmentReadyso the SDK's listeners stay registered. (J#HYB-957) - Implements
NutrientDocumentInterface.exportPdfon the federated Android plugin via the synchronousPdfProcessor.processDocument(task, file, saveOptions)JNI overload. HonoursDocumentSaveOptions.flattenandDocumentSaveOptions.excludeAnnotationsviaPdfProcessorTask.changeAllAnnotations(FLATTEN | DELETE), andDocumentSaveOptions.optimizeviaDocumentSaveOptions.setRewriteAndOptimizeFileSize. The processor writes to a JVM temp file (viajava.io.File.createTempFile), the Dart side reads it back as bytes and best-effort-deletes it. Password / permissions / pdf-version mapping is still defaults-only — track richer save-options support as a follow-up. (J#HYB-951) - Adds
utils/jni_file.dart, a small raw-JNI helper forjava.io.File(constructor from path,createTempFile,getAbsolutePath,delete). jnigen doesn't bindjava.io.Filesince it isn't part of the Nutrient SDK surface, but the syncPdfProcessor.processDocument(...)overload needs one. (J#HYB-951)
1.2.0 18 Jun 2026 #
- Adds AI Assistant support to
NutrientInstantViewAndroidviaNutrientViewConfiguration.aiAssistantConfiguration. - Honours
NutrientViewConfiguration.enableInstantCommentsinAndroidConfigurationBuilderby appendingINSTANT_COMMENT_MARKERandINSTANT_HIGHLIGHT_COMMENTto the enabled annotation tools. - Updates to Nutrient Android SDK 11.5.1, migrating to the 11.5 toolbar APIs and jni 1.0 bindings. (#54079)
1.1.0 09 Apr 2026 #
- Adds
NutrientInstantViewAndroid, an Android implementation of the embedded Instant document widget usingInstantPdfUiFragmentvia JNI. (J#HYB-988) - Adds
AndroidConfigurationBuilderto convertNutrientViewConfigurationinto the native Android viewer configuration. (J#HYB-988) - Sets Android
compileSdkVersionandtargetSdkVersionto 36. (J#HYB-990)
1.0.0 13 Feb 2026 #
- Initial release as standalone pub.dev package.
- Native Android bindings using JNI for direct Nutrient Android SDK integration.
- Provides platform adapter to extend
nutrient_flutterwith native bindings. - Implements
nutrient_flutter_platform_interfacefor the federated plugin architecture.