selectableRegionKey property
A key applied to the internal SmoothSelectionRegion widget.
Prefer selectionController for new code. This key remains available for advanced integrations that need direct access to SmoothSelectionRegionState.
final regionKey = GlobalKey<SmoothSelectionRegionState>();
SmoothMarkdown(
data: markdownText,
selectable: true,
selectableRegionKey: regionKey,
)
// Later, trigger full-text selection (shows handles + toolbar):
regionKey.currentState?.selectAll(SelectionChangedCause.toolbar);
// Or dispatch a raw SelectionEvent to the SelectionContainer:
regionKey.currentState?.dispatchEvent(const SelectAllSelectionEvent());
Only meaningful when selectable is true.
Defaults to null.
Implementation
final GlobalKey<SmoothSelectionRegionState>? selectableRegionKey;