getDefaultItems static method

List<IOSSystemContextMenuItem> getDefaultItems(
  1. EditableTextState editableTextState
)

The default items for the given EditableTextState.

For example, IOSSystemContextMenuItemCopy will only be included when the field represented by the EditableTextState has a selection.

See also:

Implementation

static List<IOSSystemContextMenuItem> getDefaultItems(EditableTextState editableTextState) {
  return <IOSSystemContextMenuItem>[
    if (editableTextState.copyEnabled) const IOSSystemContextMenuItemCopy(),
    if (editableTextState.cutEnabled) const IOSSystemContextMenuItemCut(),
    if (editableTextState.pasteEnabled) const IOSSystemContextMenuItemPaste(),
    if (editableTextState.selectAllEnabled) const IOSSystemContextMenuItemSelectAll(),
    if (editableTextState.lookUpEnabled) const IOSSystemContextMenuItemLookUp(),
    if (editableTextState.searchWebEnabled) const IOSSystemContextMenuItemSearchWeb(),
  ];
}