contextMenuAnchors property

TextSelectionToolbarAnchors contextMenuAnchors

Returns the anchor points for the default context menu.

See also:

Implementation

TextSelectionToolbarAnchors get contextMenuAnchors {
  if (renderEditable.lastSecondaryTapDownPosition != null) {
    return TextSelectionToolbarAnchors(
      primaryAnchor: renderEditable.lastSecondaryTapDownPosition!,
    );
  }

  final _GlyphHeights glyphHeights = _getGlyphHeights();
  final TextSelection selection = textEditingValue.selection;
  final List<TextSelectionPoint> points =
      renderEditable.getEndpointsForSelection(selection);
  return TextSelectionToolbarAnchors.fromSelection(
    renderBox: renderEditable,
    startGlyphHeight: glyphHeights.start,
    endGlyphHeight: glyphHeights.end,
    selectionEndpoints: points,
  );
}