AdaptiveTextSelectionToolbar class
The default context menu for text selection for the current platform.
Typically, this widget would be passed to contextMenuBuilder
in a
supported parent widget, such as:
- EditableText.contextMenuBuilder
- TextField.contextMenuBuilder
- CupertinoTextField.contextMenuBuilder
- SelectionArea.contextMenuBuilder
- SelectableText.contextMenuBuilder
See also:
- EditableText.getEditableButtonItems, which returns the default ContextMenuButtonItems for EditableText on the platform.
- AdaptiveTextSelectionToolbar.getAdaptiveButtons, which builds the button Widgets for the current platform given ContextMenuButtonItems.
- CupertinoAdaptiveTextSelectionToolbar, which does the same thing as this widget but only for Cupertino context menus.
- TextSelectionToolbar, the default toolbar for Android.
- DesktopTextSelectionToolbar, the default toolbar for desktop platforms other than MacOS.
- CupertinoTextSelectionToolbar, the default toolbar for iOS.
- CupertinoDesktopTextSelectionToolbar, the default toolbar for MacOS.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- AdaptiveTextSelectionToolbar
Constructors
-
AdaptiveTextSelectionToolbar({Key? key, required List<
Widget> ? children, required TextSelectionToolbarAnchors anchors}) -
Create an instance of AdaptiveTextSelectionToolbar with the
given
children
.const -
Create an instance of AdaptiveTextSelectionToolbar whose children will
be built from the given
buttonItems
.const - AdaptiveTextSelectionToolbar.editable({Key? key, required ClipboardStatus clipboardStatus, required VoidCallback? onCopy, required VoidCallback? onCut, required VoidCallback? onPaste, required VoidCallback? onSelectAll, required VoidCallback? onLookUp, required VoidCallback? onSearchWeb, required VoidCallback? onLiveTextInput, required TextSelectionToolbarAnchors anchors})
- Create an instance of AdaptiveTextSelectionToolbar with the default children for an editable field.
- AdaptiveTextSelectionToolbar.editableText({Key? key, required EditableTextState editableTextState})
- Create an instance of AdaptiveTextSelectionToolbar with the default children for an EditableText.
- AdaptiveTextSelectionToolbar.selectable({Key? key, required VoidCallback onCopy, required VoidCallback onSelectAll, required SelectionGeometry selectionGeometry, required TextSelectionToolbarAnchors anchors})
- Create an instance of AdaptiveTextSelectionToolbar with the default children for selectable, but not editable, content.
- AdaptiveTextSelectionToolbar.selectableRegion({Key? key, required SelectableRegionState selectableRegionState})
- Create an instance of AdaptiveTextSelectionToolbar with the default children for a SelectableRegion.
Properties
- anchors → TextSelectionToolbarAnchors
-
The location on which to anchor the menu.
final
-
- AdaptiveTextSelectionToolbar.buttonItems, which takes a list of ContextMenuButtonItems instead of children widgets.
final -
children
→ List<
Widget> ? -
The children of the toolbar, typically buttons.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getAdaptiveButtons(
BuildContext context, List< ContextMenuButtonItem> buttonItems) → Iterable<Widget> -
Returns a List of Widgets generated by turning
buttonItems
into the default context menu buttons for the current platform. -
getButtonLabel(
BuildContext context, ContextMenuButtonItem buttonItem) → String - Returns the default button label String for the button of the given ContextMenuButtonType on any platform.