onSingleLongTapMoveUpdate method
Handler for TextSelectionGestureDetector.onSingleLongTapMoveUpdate.
By default, it updates the selection location specified in details
if
selection is enabled.
See also:
- TextSelectionGestureDetector.onSingleLongTapMoveUpdate, which triggers this callback.
Implementation
@override
void onSingleLongTapMoveUpdate(LongPressMoveUpdateDetails details) {
if (delegate.selectionEnabled) {
switch (Theme.of(_context).platform) {
case TargetPlatform.iOS:
case TargetPlatform.macOS:
renderEditable.selectPositionAt(
from: details.globalPosition,
cause: SelectionChangedCause.longPress,
);
break;
case TargetPlatform.android:
case TargetPlatform.fuchsia:
case TargetPlatform.linux:
case TargetPlatform.windows:
renderEditable.selectWordsInRange(
from: details.globalPosition - details.offsetFromOrigin,
to: details.globalPosition,
cause: SelectionChangedCause.longPress,
);
break;
}
}
}