SelectionOverlay class Null safety

An object that manages a pair of selection handles and a toolbar.

The selection handles are displayed in the Overlay that most closely encloses the given BuildContext.

Constructors

SelectionOverlay({required BuildContext context, Widget? debugRequiredFor, required TextSelectionHandleType startHandleType, required double lineHeightAtStart, ValueListenable<bool>? startHandlesVisible, ValueChanged<DragStartDetails>? onStartHandleDragStart, ValueChanged<DragUpdateDetails>? onStartHandleDragUpdate, ValueChanged<DragEndDetails>? onStartHandleDragEnd, required TextSelectionHandleType endHandleType, required double lineHeightAtEnd, ValueListenable<bool>? endHandlesVisible, ValueChanged<DragStartDetails>? onEndHandleDragStart, ValueChanged<DragUpdateDetails>? onEndHandleDragUpdate, ValueChanged<DragEndDetails>? onEndHandleDragEnd, ValueListenable<bool>? toolbarVisible, required List<TextSelectionPoint> selectionEndpoints, required TextSelectionControls? selectionControls, required TextSelectionDelegate selectionDelegate, required ClipboardStatusNotifier? clipboardStatus, required LayerLink startHandleLayerLink, required LayerLink endHandleLayerLink, required LayerLink toolbarLayerLink, DragStartBehavior dragStartBehavior = DragStartBehavior.start, VoidCallback? onSelectionHandleTapped, Offset? toolbarLocation})
Creates an object that manages overlay entries for selection handles.

Properties

clipboardStatus ClipboardStatusNotifier?
Maintains the status of the clipboard for determining if its contents can be pasted or not.
final
context BuildContext
The context in which the selection handles should appear.
final
debugRequiredFor Widget?
Debugging information for explaining why the Overlay is required.
final
dragStartBehavior DragStartBehavior
Determines the way that drag start behavior is handled.
final
The objects supplied to the CompositedTransformTarget that wraps the location of end selection handle.
final
endHandlesVisible ValueListenable<bool>?
Whether the end handle is visible.
final
endHandleType TextSelectionHandleType
The type of end selection handle.
read / write
hashCode int
The hash code for this object.
read-onlyinherited
lineHeightAtEnd double
The line height at the selection end.
read / write
lineHeightAtStart double
The line height at the selection start.
read / write
onEndHandleDragEnd ValueChanged<DragEndDetails>?
Called when the users lift their fingers after dragging the end selection handles.
final
onEndHandleDragStart ValueChanged<DragStartDetails>?
Called when the users start dragging the end selection handles.
final
onEndHandleDragUpdate ValueChanged<DragUpdateDetails>?
Called when the users drag the end selection handles to new locations.
final
onSelectionHandleTapped VoidCallback?
A callback that's optionally invoked when a selection handle is tapped.
final
onStartHandleDragEnd ValueChanged<DragEndDetails>?
Called when the users lift their fingers after dragging the start selection handles.
final
onStartHandleDragStart ValueChanged<DragStartDetails>?
Called when the users start dragging the start selection handles.
final
onStartHandleDragUpdate ValueChanged<DragUpdateDetails>?
Called when the users drag the start selection handles to new locations.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
selectionControls TextSelectionControls?
Builds text selection handles and toolbar.
final
selectionDelegate TextSelectionDelegate
The delegate for manipulating the current selection in the owning text field.
final
selectionEndpoints List<TextSelectionPoint>
The text selection positions of selection start and end.
read / write
The objects supplied to the CompositedTransformTarget that wraps the location of start selection handle.
final
startHandlesVisible ValueListenable<bool>?
Whether the start handle is visible.
final
startHandleType TextSelectionHandleType
The type of start selection handle.
read / write
The object supplied to the CompositedTransformTarget that wraps the text field.
final
toolbarLocation Offset?
The location of where the toolbar should be drawn in relative to the location of toolbarLayerLink.
read / write
toolbarVisible ValueListenable<bool>?
Whether the toolbar is visible.
final

Methods

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.
hideToolbar() → void
Hides the toolbar part of the overlay.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
showHandles() → void
Builds the handles by inserting them into the context's overlay.
showToolbar() → void
Shows the toolbar by inserting it into the context's overlay.
toString() String
A string representation of this object.
inherited

Operators

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

Constants

fadeDuration → const Duration
Controls the fade-in and fade-out animations for the toolbar and handles.
Duration(milliseconds: 150)