FlutterSelectionControls class

This package allows you to create custom text selection controls and use them in the SelectableText widget or in the TextForm or TextFormField widgets.

Example 1:

SelectableText(
 ...,
 selectionControls: FlutterSelectionControls(
  toolBarItems: <ToolBarItem>[]
 ),
...
)

Example 2:

TextFormField(
  selectionControls: FlutterSelectionControls(
    toolBarItems: <ToolBarItem>[]
  ),
...
)
Inheritance

Constructors

FlutterSelectionControls({required List<ToolBarItem> toolBarItems, double horizontalPadding = 16, double verticalPadding = 10})
FlutterSelectionControls takes a list of ToolBarItem(s) as arguments The ToolBarItems takes a widget as an argument and it will be shown on the tool bar when the text is selected

Properties

hashCode int
The hash code for this object.
no setterinherited
horizontalPadding double
This controls the amount of horizontal space between each tool bar item
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toolBarItems List<ToolBarItem>
final
verticalPadding double
This controls the amount of vertical space between each tool bar item and the text selection tool bar
final

Methods

buildHandle(BuildContext context, TextSelectionHandleType type, double textHeight, [VoidCallback? onTap]) Widget
Builder for material-style text selection handles.
inherited
buildToolbar(BuildContext context, Rect globalEditableRegion, double textLineHeight, Offset? selectionMidpoint, List<TextSelectionPoint> endpoints, TextSelectionDelegate delegate, ClipboardStatusNotifier clipboardStatus, Offset? lastSecondaryTapDownPosition) Widget
Builder for material-style copy/paste text selection toolbar.
override
canCopy(TextSelectionDelegate delegate) bool
Whether the current selection of the text field managed by the given delegate can be copied to the Clipboard.
inherited
canCut(TextSelectionDelegate delegate) bool
Whether the current selection of the text field managed by the given delegate can be removed from the text field and placed into the Clipboard.
inherited
canPaste(TextSelectionDelegate delegate) bool
Whether the text field managed by the given delegate supports pasting from the clipboard.
inherited
canSelectAll(TextSelectionDelegate delegate) bool
Whether the current selection of the text field managed by the given delegate can be extended to include the entire content of the text field.
inherited
getHandleAnchor(TextSelectionHandleType type, double textLineHeight) Offset
Gets anchor for material-style text selection handles.
inherited
getHandleSize(double textLineHeight) Size
Returns the size of the Material handle.
inherited
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