contextMenuButtonItems property
Returns the ContextMenuButtonItem
s representing the buttons in this
platform's default selection menu for EditableText.
See also:
- EditableText.getEditableButtonItems, which performs a similar role, but for any editable field, not just specifically EditableText.
- SelectableRegionState.contextMenuButtonItems, which performs a similar role but for content that is selectable but not editable.
- contextMenuAnchors, which provides the anchor points for the default context menu.
- AdaptiveTextSelectionToolbar, which builds the toolbar itself, and can
take a list of
ContextMenuButtonItem
s with AdaptiveTextSelectionToolbar.buttonItems. - AdaptiveTextSelectionToolbar.getAdaptiveButtons, which builds the
button Widgets for the current platform given
ContextMenuButtonItem
s.
Implementation
List<ContextMenuButtonItem> get contextMenuButtonItems {
return buttonItemsForToolbarOptions() ?? EditableText.getEditableButtonItems(
clipboardStatus: clipboardStatus.value,
onCopy: copyEnabled
? () => copySelection(SelectionChangedCause.toolbar)
: null,
onCut: cutEnabled
? () => cutSelection(SelectionChangedCause.toolbar)
: null,
onPaste: pasteEnabled
? () => pasteText(SelectionChangedCause.toolbar)
: null,
onSelectAll: selectAllEnabled
? () => selectAll(SelectionChangedCause.toolbar)
: null,
onLookUp: lookUpEnabled
? () => lookUpSelection(SelectionChangedCause.toolbar)
: null,
onSearchWeb: searchWebEnabled
? () => searchWebForSelection(SelectionChangedCause.toolbar)
: null,
onShare: shareEnabled
? () => shareSelection(SelectionChangedCause.toolbar)
: null,
onLiveTextInput: liveTextInputEnabled
? () => _startLiveTextInput(SelectionChangedCause.toolbar)
: null,
)..addAll(_textProcessingActionButtonItems);
}