---
title: "Flutter PDF text selection events and notifications | Nutrient"
canonical_url: "https://www.nutrient.io/guides/flutter/events-and-notifications/text-selection/"
md_url: "https://www.nutrient.io/guides/flutter/events-and-notifications/text-selection.md"
last_updated: "2026-07-04T00:00:00.000Z"
description: "Listen for text selection events in Nutrient Flutter SDK when users select text in a document."
---

# Text selection events and notifications

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:

```dart

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](https://www.nutrient.io/guides/flutter/customize.md) guide and the following guides for more information:

- [iOS](https://www.nutrient.io/guides/ios/events-and-notifications.md)

- [Android](https://www.nutrient.io/guides/android/events-and-notifications.md)

- [Web](https://www.nutrient.io/guides/web/events.md)
---

## Related pages

- [PDF events and notifications](/guides/flutter/events-and-notifications.md)
- [Analytics events and notifications](/guides/flutter/events-and-notifications/analytics.md)
- [Annotation events and notifications](/guides/flutter/events-and-notifications/annotation.md)
- [PDF form events and notifications](/guides/flutter/events-and-notifications/forms.md)
- [Viewer events and notifications](/guides/flutter/events-and-notifications/viewer.md)

