onlyShowInSingleSelectionAndTextType function

bool onlyShowInSingleSelectionAndTextType(
  1. EditorState editorState
)

Implementation

bool onlyShowInSingleSelectionAndTextType(EditorState editorState) {
  final selection = editorState.selection;
  if (selection == null || !selection.isSingle) {
    return false;
  }
  final node = editorState.getNodeAtPath(selection.start.path);
  if (node == null) {
    return false;
  }
  return node.delta != null && toolbarItemWhiteList.contains(node.type);
}