onTapDown method

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

Handler for EditorTextSelectionGestureDetector.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) {
  renderEditor!.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 kind = details.kind;
  shouldShowSelectionToolbar = kind == null ||
      kind == PointerDeviceKind.mouse || // Enable word selection by mouse double tap
      kind == PointerDeviceKind.touch ||
      kind == PointerDeviceKind.stylus;
}