contextMenuButtonItems property

List<ContextMenuButtonItem> get contextMenuButtonItems

Returns the ContextMenuButtonItems representing the buttons in this platform's default selection menu.

See also:

Implementation

List<ContextMenuButtonItem> get contextMenuButtonItems {
  return SelectableRegion.getSelectableButtonItems(
    selectionGeometry: _selectionDelegate.value,
    onCopy: () {
      _copy();

      // On Android copy should clear the selection.
      switch (defaultTargetPlatform) {
        case TargetPlatform.android:
        case TargetPlatform.fuchsia:
          clearSelection();
        case TargetPlatform.iOS:
          hideToolbar(false);
        case TargetPlatform.linux:
        case TargetPlatform.macOS:
        case TargetPlatform.windows:
          hideToolbar();
      }
    },
    onSelectAll: () {
      switch (defaultTargetPlatform) {
        case TargetPlatform.android:
        case TargetPlatform.iOS:
        case TargetPlatform.fuchsia:
          selectAll(SelectionChangedCause.toolbar);
        case TargetPlatform.linux:
        case TargetPlatform.macOS:
        case TargetPlatform.windows:
          selectAll();
          hideToolbar();
      }
    },
    onShare: () {
      _share();

      // On Android, share should clear the selection.
      switch (defaultTargetPlatform) {
        case TargetPlatform.android:
        case TargetPlatform.fuchsia:
          clearSelection();
        case TargetPlatform.iOS:
          hideToolbar(false);
        case TargetPlatform.linux:
        case TargetPlatform.macOS:
        case TargetPlatform.windows:
          hideToolbar();
      }
    },
  )..addAll(_textProcessingActionButtonItems);
}