onDragSelectionStart method
Handler for TextSelectionGestureDetector.onDragSelectionStart.
By default, it selects a text position specified in details
.
See also:
- TextSelectionGestureDetector.onDragSelectionStart, which triggers this callback.
Implementation
@protected
void onDragSelectionStart(DragStartDetails details) {
if (!delegate.selectionEnabled) {
return;
}
final PointerDeviceKind? kind = details.kind;
_shouldShowSelectionToolbar = kind == null ||
kind == PointerDeviceKind.touch ||
kind == PointerDeviceKind.stylus;
renderEditable.selectPositionAt(
from: details.globalPosition,
cause: SelectionChangedCause.drag,
);
}