selectionController property

SmoothSelectionController? selectionController
final

Controller for programmatic text selection.

This is the preferred way to drive selection from application code because it avoids exposing widget state through a GlobalKey. It is only attached when selectable is true.

final controller = SmoothSelectionController();

SmoothMarkdown(
  data: markdownText,
  selectable: true,
  selectionController: controller,
)

// Later, select the paragraph under a long-press point:
controller.selectParagraphAt(details.globalPosition);

Defaults to null.

Implementation

final SmoothSelectionController? selectionController;