dispatchEvent method

SelectionResult? dispatchEvent(
  1. SelectionEvent event
)

Dispatch an arbitrary SelectionEvent to the contained SelectionContainer's delegate.

The container fans the event out to every registered text selectable in the subtree. For example, to programmatically select everything without driving the overlay:

state.dispatchEvent(const SelectAllSelectionEvent());

Note: dispatching an event directly does not, by itself, show or hide the selection handles/toolbar. Use selectAll / clearSelection when you need the overlay to react; use dispatchEvent when you want raw fan-out only. Returns the SelectionResult reported by the container (or null if the container has not mounted yet).

Implementation

SelectionResult? dispatchEvent(SelectionEvent event) =>
    _containerHandler?.dispatchSelectionEvent(event);