onTapDown method
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:
- TextSelectionGestureDetector.onTapDown, which triggers this callback.
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;
}