onSingleLongTapStart method
Handler for TextSelectionGestureDetector.onSingleLongTapStart.
By default, it selects text position specified in details
if selection
is enabled.
See also:
- TextSelectionGestureDetector.onSingleLongTapStart, which triggers this callback.
Implementation
@override
void onSingleLongTapStart(LongPressStartDetails details) {
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.selectWord(cause: SelectionChangedCause.longPress);
Feedback.forLongPress(_context);
break;
}
}