onTapDown method Null safety

  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:


void onTapDown(TapDownDetails 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;