onSingleLongTapStart method

  1. @override
void onSingleLongTapStart(
  1. LongPressStartDetails details
)
override

Handler for TextSelectionGestureDetector.onSingleLongTapStart.

By default, it selects text position specified in details if selection is enabled.

See also:

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;
  }
}