onTapDown method

  1. @protected
void onTapDown(
  1. TapDownDetails details
)

Handler for TextSelectionGestureDetector.onTapDown.

By default, it forwards the tap to RenderEditable.handleTapDown and sets shouldShowSelectionToolbar to true if the tap was initiated by a finger or stylus.

See also:

Implementation

@protected
void onTapDown(TapDownDetails details) {
  renderEditable.handleTapDown(details);
  // The selection overlay should only be shown when the user is interacting
  // through a touch screen (via either a finger or a stylus). A mouse shouldn't
  // trigger the selection overlay.
  // For backwards-compatibility, we treat a null kind the same as touch.
  final PointerDeviceKind? kind = details.kind;
  _shouldShowSelectionToolbar = kind == null ||
      kind == PointerDeviceKind.touch ||
      kind == PointerDeviceKind.stylus;
}