This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/flutter/knowledge-base/flutter-sending-data-to-dart.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. How do I send data from iOS to Dart in Flutter?

In Nutrient Flutter SDK 6, you no longer need to edit the plugin or wire up a FlutterMethodChannel to send data from native code back to Dart. Use platform adapters to bridge native callbacks into your Dart code:

  • Cross-platform events — Listen to most document, page, annotation, and form events through the typed controller.events stream. You don’t need native code for these events.
  • Platform-only events — Use platform-specific streams for events that don’t have a cross-platform equivalent, such as iosEvents on IOSAdapter and androidEvents on AndroidAdapter.
  • Custom native callbacks — Subclass the platform adapter to observe native APIs, such as notifications or delegate methods, and emit your own events to Dart. The adapter provides access to the native PSPDFViewController on iOS and PdfFragment on Android through its escape-hatch accessors.

The following example listens for page changes with a single subscription:

NutrientDocumentView(
documentPath: documentPath,
onControllerReady: (controller) {
controller.events.pageChanged.listen((event) {
print('Page changed to ${event.pageIndex}');
});
},
)

For a walkthrough of subclassing an adapter and emitting custom events from native code, refer to the platform adapters guide and the event listeners section in the platform adapter usage patterns guide.

The previous approach — editing PspdfkitPlugin.m and registering callbacks on the Pspdfkit class through a method channel — is part of the legacy method-channel API. You no longer need it.