onForcePressStart method Null safety

  1. @protected
void onForcePressStart(
  1. ForcePressDetails details
)

Handler for TextSelectionGestureDetector.onForcePressStart.

By default, it selects the word at the position of the force press, if selection is enabled.

This callback is only applicable when force press is enabled.

See also:

Implementation

@protected
void onForcePressStart(ForcePressDetails details) {
  assert(delegate.forcePressEnabled);
  _shouldShowSelectionToolbar = true;
  if (delegate.selectionEnabled) {
    renderEditable.selectWordsInRange(
      from: details.globalPosition,
      cause: SelectionChangedCause.forcePress,
    );
  }
}