tripleTapAtDocumentPosition method

Future<void> tripleTapAtDocumentPosition(
  1. DocumentPosition position, [
  2. Finder? superEditorFinder
])

Triple-taps at the center of the content at the given position within a SuperEditor.

By default, this method expects a single SuperEditor in the widget tree and finds it byType. To specify one SuperEditor among many, pass a superEditorFinder.

Implementation

Future<void> tripleTapAtDocumentPosition(DocumentPosition position, [Finder? superEditorFinder]) async {
  final documentLayout = _findDocumentLayout(superEditorFinder);
  final positionRectInDoc = documentLayout.getRectForPosition(position)!;
  final globalTapOffset = documentLayout.getAncestorOffsetFromDocumentOffset(positionRectInDoc.center);

  await tapAt(globalTapOffset);
  await pump(kTapMinTime);
  await tapAt(globalTapOffset);
  await pump(kTapMinTime);
  await tapAt(globalTapOffset);
}