onDoubleTapDown method

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

Handler for EditorTextSelectionGestureDetector.onDoubleTapDown.

By default, it selects a word through RenderEditable.selectWord if selectionEnabled and shows toolbar if necessary.

See also:

Implementation

@protected
void onDoubleTapDown(TapDownDetails details) {
  if (delegate.selectionEnabled) {
    renderEditor!.selectWord(SelectionChangedCause.tap);
    // allow the selection to get updated before trying to bring up
    // toolbars.
    //
    // if double tap happens on an editor that doesn't
    // have focus, selection hasn't been set when the toolbars
    // get added
    SchedulerBinding.instance.addPostFrameCallback((_) {
      if (shouldShowSelectionToolbar) {
        editor!.showToolbar();
      }
    });
  }
}