CustomColorSelectionHandle class
Text selection controls that uses the given handleColor as the color for handles when selecting text.
This is a workaround to account for the issue that text forms do not respect the surrounding text selection theme due to overlay context stuff.
Based on the code provided in Flutter issue #74890
- Inheritance
-
- Object
- TextSelectionControls
- CustomColorSelectionHandle
Constructors
- CustomColorSelectionHandle(Color handleColor)
Properties
- handleColor → Color
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
buildHandle(
BuildContext context, TextSelectionHandleType type, double textLineHeight, [VoidCallback? onTap]) → Widget -
Builds a selection handle of the given
type.override -
buildToolbar(
BuildContext context, Rect globalEditableRegion, double textLineHeight, Offset selectionMidpoint, List< TextSelectionPoint> endpoints, TextSelectionDelegate delegate, ValueListenable<ClipboardStatus> ? clipboardStatus, Offset? lastSecondaryTapDownPosition) → Widget -
Builds a toolbar near a text selection.
override
-
canCopy(
TextSelectionDelegate delegate) → bool -
Whether the current selection of the text field managed by the given
delegatecan be copied to the Clipboard.inherited -
canCut(
TextSelectionDelegate delegate) → bool -
Whether the current selection of the text field managed by the given
delegatecan be removed from the text field and placed into the Clipboard.inherited -
canPaste(
TextSelectionDelegate delegate) → bool -
Whether the text field managed by the given
delegatesupports pasting from the clipboard.inherited -
canSelectAll(
TextSelectionDelegate delegate) → bool -
Whether the current selection of the text field managed by the given
delegatecan be extended to include the entire content of the text field.inherited -
getHandleAnchor(
TextSelectionHandleType type, double textLineHeight) → Offset -
Get the anchor point of the handle relative to itself. The anchor point is
the point that is aligned with a specific point in the text. A handle
often visually "points to" that location.
override
-
getHandleSize(
double textLineHeight) → Size -
Returns the size of the selection handle.
override
-
handleCopy(
TextSelectionDelegate delegate) → void -
Call TextSelectionDelegate.copySelection to copy current selection.
inherited
-
handleCut(
TextSelectionDelegate delegate) → void -
Call TextSelectionDelegate.cutSelection to cut current selection.
inherited
-
handlePaste(
TextSelectionDelegate delegate) → Future< void> -
Call TextSelectionDelegate.pasteText to paste text.
inherited
-
handleSelectAll(
TextSelectionDelegate delegate) → void -
Call TextSelectionDelegate.selectAll to set the current selection to
contain the entire text value.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
onPrimaryFor(
BuildContext context) → CustomColorSelectionHandle