TextSelectionOverlay class Null safety

An object that manages a pair of text selection handles for a RenderEditable.

This class is a wrapper of SelectionOverlay to provide APIs specific for RenderEditables. To manage selection handles for custom widgets, use SelectionOverlay instead.


TextSelectionOverlay({required TextEditingValue value, required BuildContext context, Widget? debugRequiredFor, required LayerLink toolbarLayerLink, required LayerLink startHandleLayerLink, required LayerLink endHandleLayerLink, required RenderEditable renderObject, TextSelectionControls? selectionControls, bool handlesVisible = false, required TextSelectionDelegate selectionDelegate, DragStartBehavior dragStartBehavior = DragStartBehavior.start, VoidCallback? onSelectionHandleTapped, ClipboardStatusNotifier? clipboardStatus, WidgetBuilder? contextMenuBuilder, required TextMagnifierConfiguration magnifierConfiguration})
Creates an object that manages overlay entries for selection handles.


context BuildContext
The context in which the selection UI should appear.
contextMenuBuilder WidgetBuilder?
Builds the text selection toolbar when requested by the user.
handlesAreVisible bool
Whether the handles are currently visible.
handlesVisible bool
Whether selection handles are visible.
read / write
hashCode int
The hash code for this object.
magnifierIsVisible bool
Whether the magnifier is currently visible.
renderObject RenderEditable
The editable line in which the selected text is being displayed.
runtimeType Type
A representation of the runtime type of the object.
selectionControls TextSelectionControls?
Builds text selection handles and toolbar.
selectionDelegate TextSelectionDelegate
The delegate for manipulating the current selection in the owning text field.
toolbarIsVisible bool
Whether the toolbar is currently visible.
value TextEditingValue
Retrieve current value.


dispose() → void
Disposes this object and release resources.
hide() → void
Hides the entire overlay including the toolbar and the handles.
hideHandles() → void
Destroys the handles by removing them from overlay.
hideMagnifier() → void
Hide the current magnifier.
hideToolbar() → void
Hides the toolbar part of the overlay.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
showHandles() → void
Builds the handles by inserting them into the context's overlay.
showMagnifier(Offset positionToShow) → void
Shows the magnifier, and hides the toolbar if it was showing when showMagnifier was called. This is safe to call on platforms not mobile, since a magnifierBuilder will not be provided, or the magnifierBuilder will return null on platforms not mobile.
showToolbar() → void
Shows the toolbar by inserting it into the context's overlay.
toString() String
A string representation of this object.
update(TextEditingValue newValue) → void
Updates the overlay after the selection has changed.
updateForScroll() → void
Causes the overlay to update its rendering.
updateMagnifier(Offset positionToShow) → void
Update the current magnifier with new selection data, so the magnifier can respond accordingly.


operator ==(Object other) bool
The equality operator.


fadeDuration → const Duration
Controls the fade-in and fade-out animations for the toolbar and handles.