contextMenuAnchors property
Returns the anchor points for the default context menu.
See also:
- contextMenuButtonItems, which provides the ContextMenuButtonItems for the default context menu buttons.
Implementation
TextSelectionToolbarAnchors get contextMenuAnchors {
if (_lastSecondaryTapDownPosition != null) {
return TextSelectionToolbarAnchors(
primaryAnchor: _lastSecondaryTapDownPosition!,
);
}
final RenderBox renderBox = context.findRenderObject()! as RenderBox;
return TextSelectionToolbarAnchors.fromSelection(
renderBox: renderBox,
startGlyphHeight: startGlyphHeight,
endGlyphHeight: endGlyphHeight,
selectionEndpoints: selectionEndpoints,
);
}