This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/flutter/events-and-notifications/text-selection.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Flutter PDF text selection events and notifications | Nutrient

Nutrient Flutter SDK emits events when users select text in a document.

Text selection events

Subscribe to controller.events.textSelectionChanged from the NutrientDocumentView onControllerReady callback to respond to text selection changes. The TextSelectionChangedEvent exposes the selected text through event.selectedText. This value is null when the user clears the selection.

Use the following listener to respond to text selection changes:

NutrientDocumentView(
documentPath: documentPath,
onControllerReady: (controller) {
controller.events.textSelectionChanged.listen((event) {
print('Text selection changed: ${event.selectedText}');
});
},
)

For advanced customization, use the Nutrient native and web SDKs. Refer to the Nutrient Flutter SDK customization guide and the following guides for more information: